Project

General

Profile

Bug #987

clang don't handle properly "-framework" parameter in link mode

Added by Dmitry Moskalchuk over 4 years ago. Updated about 4 years ago.

Status:
Open
Priority:
Normal
Category:
-
Target version:
Start date:
06/26/2015
Due date:
% Done:

0%

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

Description

$ /opt/android/crystax-ndk-10.2.0/build/tools/make-standalone-toolchain.sh \
--toolchain=arm-linux-androideabi-clang3.6 --install-dir=/tmp/android-arm
Auto-config: --arch=arm
Auto-config: --toolchain=arm-linux-androideabi-4.8, --llvm-version=3.6
Auto-config: --platform=android-3
Copying prebuilt binaries...
Copying sysroot headers and libraries...
Copying crystax headers and libraries...
Copying libpng headers and libraries...
Copying libjpeg headers and libraries...
Copying libtiff headers and libraries...
Copying libobjc headers and libraries...
Copying c++ runtime headers and libraries...
Copying files to: /tmp/android-arm
Cleaning up...
Done.

$ /tmp/android-arm/bin/clang++ -target armv7-none-linux-androideabi \
-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb \
--sysroot=/opt/android/crystax-ndk-10.2.0/platforms/android-21/arch-arm \
-c -o ao.o ao.m \
-F/opt/android/crystax-ndk-10.2.0/sources/objc/cocotron/0.1.0/frameworks/armeabi-v7a \
-framework Foundation -framework CoreFoundation
clang36: warning: -framework Foundation: 'linker' input unused
clang36: warning: -framework CoreFoundation: 'linker' input unused

$ /tmp/android-arm/bin/clang++ -v -target armv7-none-linux-androideabi \
-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb \
--sysroot=/opt/android/crystax-ndk-10.2.0/platforms/android-21/arch-arm \
-F/opt/android/crystax-ndk-10.2.0/sources/objc/cocotron/0.1.0/frameworks/armeabi-v7a \
-framework Foundation -framework CoreFoundation \
-o ao ao.o
clang version 3.6
Target: armv7-none-linux-androideabi
Thread model: posix
Found candidate GCC installation: /tmp/android-arm/bin/../lib/gcc/arm-linux-androideabi/4.8
Selected GCC installation: /tmp/android-arm/bin/../lib/gcc/arm-linux-androideabi/4.8
Candidate multilib: armv7-a/thumb/hard;@march=armv7-a@mhard-float@mthumb
Candidate multilib: armv7-a/hard;@march=armv7-a@mhard-float
Candidate multilib: armv7-a/thumb;@march=armv7-a@mthumb
Candidate multilib: armv7-a;@march=armv7-a
Candidate multilib: thumb;@mthumb
Candidate multilib: .;
Selected multilib: armv7-a/thumb;@march=armv7-a@mthumb
clang36: warning: argument unused during compilation: '-F/opt/android/crystax-ndk-10.2.0/sources/objc/cocotron/0.1.0/frameworks/armeabi-v7a'
"/tmp/android-arm/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld" \
--sysroot=/opt/android/crystax-ndk-10.2.0/platforms/android-21/arch-arm -pie -X --eh-frame-hdr \
-m armelf_linux_eabi -dynamic-linker /system/bin/linker -o ao \
/opt/android/crystax-ndk-10.2.0/platforms/android-21/arch-arm/usr/lib/../lib/crtbegin_dynamic.o \
-L/tmp/android-arm/bin/../lib/gcc/arm-linux-androideabi/4.8/armv7-a/thumb \
-L/private/tmp/android-arm/bin/../arm-linux-androideabi/lib/armv7-a/thumb \
-L/tmp/android-arm/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/lib/../lib \
-L/opt/android/crystax-ndk-10.2.0/platforms/android-21/arch-arm/usr/lib/../lib \
-L/tmp/android-arm/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/lib \
-L/opt/android/crystax-ndk-10.2.0/platforms/android-21/arch-arm/usr/lib \
-framework Foundation -framework CoreFoundation \
ao.o -lstdc++ -lm -lgcc -ldl -lcrystax -lc -lgcc -ldl \
/opt/android/crystax-ndk-10.2.0/platforms/android-21/arch-arm/usr/lib/../lib/crtend_android.o
/tmp/android-arm/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: fatal error: -f/--auxiliary may not be used without -shared
clang36: error: linker command failed with exit code 1 (use -v to see invocation)

Here @-framework Foundation@ and @-framework CoreFoundation@ are passed to linker (@/tmp/android-arm/arm-linux-androideabi/bin/ld@) directly instead of being processed by clang. It should handle these keys properly and pass @-L@ and @-l@ keys auto-detected from @-framework@ keys.

History

#1

Updated by Dmitry Moskalchuk about 4 years ago

  • Target version changed from 10.3.0 to 11.0.0

Also available in: Atom PDF