Project

General

Profile

Bug #1261

[clang][mips64] Wrong object file is generated sometimes

Added by Dmitry Moskalchuk over 3 years ago. Updated over 3 years ago.

Status:
Open
Priority:
Normal
Category:
toolchain
Target version:
Start date:
02/11/2016
Due date:
% Done:

0%

Estimated time:
CPU Architecture:
mips64
Host OS:
Toolchain:
clang-3.6, clang-3.7
Android version:
CrystaX Version:

Description

Usually compiling of mips64 binaries with clang works, but sometime (not yet clear what are pre-conditions), it generates 32-bit object file instead of 64-bit one.

Here is proper file:

$ $NDK/toolchains/llvm-3.7/prebuilt/darwin-x86_64/bin/clang++ -MMD -MP -MF ./obj/local/mips64/objs/sdktest/main.o.d \
-gcc-toolchain $NDK/toolchains/mips64el-linux-android-5/prebuilt/darwin-x86_64 -target mips64el-none-linux-android \
-fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 \
-Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes \
-fno-exceptions -fno-rtti -O2 -g -DNDEBUG -fomit-frame-pointer \
-Ijni/boost \
-I$NDK/sources/cxx-stl/gnu-libstdc++/5/include \
-I$NDK/sources/cxx-stl/gnu-libstdc++/5/libs/mips64/include \
-I$NDK/sources/cxx-stl/gnu-libstdc++/5/include/backward \
-Ijni \
-DANDROID -DCALL_X -Wa,--noexecstack -Wformat -Werror=format-security -fPIE -fexceptions -frtti -frtti -fexceptions -std=gnu++11 \
-c -I$NDK/sources/crystax/include -I$NDK/platforms/android-21/arch-mips64/usr/include \
jni/main.cpp -o ./obj/local/mips64/objs/sdktest/main.o
....
$ $NDK/toolchains/mips64el-linux-android-5/prebuilt/darwin-x86_64/bin/mips64el-linux-android-objdump -x obj/local/mips64/objs/sdktest/main.o | grep "private flags"
private flags = a0000407: [abi=64] [mips64r6] [nan2008] [not 32bitmode] [noreorder] [PIC] [CPIC]

Here is wrong file:

$ $NDK/toolchains/llvm-3.7/prebuilt/linux-x86/bin/clang++ -MMD -MP -MF ./obj/local/mips64/objs/sdktest/main.o.d \
-gcc-toolchain $NDK/toolchains/mips64el-linux-android-5/prebuilt/linux-x86 -target mips64el-none-linux-android \
-fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 \
-Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes \
-fno-exceptions -fno-rtti -O2 -g -DNDEBUG -fomit-frame-pointer \
-Ijni/boost \
-I$NDK/sources/cxx-stl/gnu-libstdc++/5/include \
-I$NDK/sources/cxx-stl/gnu-libstdc++/5/libs/mips64/include \
-I$NDK/sources/cxx-stl/gnu-libstdc++/5/include/backward \
-Ijni \
-DANDROID -DCALL_X -Wa,--noexecstack -Wformat -Werror=format-security -fPIE -fexceptions -frtti -frtti -fexceptions -std=gnu++11 \
-c -I$NDK/sources/crystax/include -I$NDK/platforms/android-21/arch-mips64/usr/include \
jni/main.cpp -o ./obj/local/mips64/objs/sdktest/main.o
....
$ $NDK/toolchains/mips64el-linux-android-5/prebuilt/linux-x86_64/bin/mips64el-linux-android-objdump -x obj/local/mips64/objs/sdktest/main.o | grep "private flags"
private flags = a0001507: [abi=O32] [mips64r6] [nan2008] [32bitmode] [noreorder] [PIC] [CPIC]

So, instead of generating object file with abi=64, sometimes it generates one with abi=O32.

main.o.xz (878 KB) Dmitry Moskalchuk, 02/11/2016 03:52 PM

History

Also available in: Atom PDF