appunite / AndroidFFmpeg

[DEPRECATED] FFmpeg build for android random architectures with example jni
Apache License 2.0
1.07k stars 471 forks source link

arm-linux-androideabi-ld: , noexecstack: unknown -z option #57

Closed Sinhbk closed 11 years ago

Sinhbk commented 11 years ago

Hi,

When I am running build_android.sh, I got the issue:

arm-linux-androideabi-ld: , noexecstack: unknown -z option

I think the issue is taken by the below code with piece code -z,noexecstack

Anyone help or suggest me how to fix it?

Thanks!

function build_one { cd ffmpeg PLATFORM=$NDK/platforms/$PLATFORM_VERSION/arch-$ARCH/ $PREBUILT/bin/$EABIARCH-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib -soname $SONAME -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $OUT_LIBRARY -lavcodec -lavformat -lavresample -lavutil -lswresample -lass -lfreetype -lfribidi -lswscale -lvo-aacenc -lvo-amrwbenc -lc -lm -lz -ldl -llog --warn-once --dynamic-linker=/system/bin/linker -zmuldefs $PREBUILT/lib/gcc/$EABIARCH/4.4.3/libgcc.a || exit 1 cd .. }

Thanks

ademar111190 commented 11 years ago

I'm get this error too:

INSTALL libavcodec/libavcodec.a
/home/ademar/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-ld: ,noexecstack: unknown -z option
/home/ademar/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-ld: use the --help option for usage information

I think the same of @Sinhbk , I go try with that code:

$PREBUILT/bin/$EABIARCH-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname $SONAME -shared -nostdlib  -z noexecstack -Bsymbolic --whole-archive --no-undefined -o $OUT_LIBRARY -lavcodec -lavformat -lavresample -lavutil -lswresample -lass -lfreetype -lfribidi -lswscale -lvo-aacenc -lvo-amrwbenc -lc -lm -lz -ldl -llog  --warn-once  --dynamic-linker=/system/bin/linker -zmuldefs $PREBUILT/lib/gcc/$EABIARCH/4.8/libgcc.a || exit 1

instead

$PREBUILT/bin/$EABIARCH-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname $SONAME -shared -nostdlib  -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $OUT_LIBRARY -lavcodec -lavformat -lavresample -lavutil -lswresample -lass -lfreetype -lfribidi -lswscale -lvo-aacenc -lvo-amrwbenc -lc -lm -lz -ldl -llog  --warn-once  --dynamic-linker=/system/bin/linker -zmuldefs $PREBUILT/lib/gcc/$EABIARCH/4.8/libgcc.a || exit 1

note the "-z noexecstack" instead "-z,noexecstack".

ademar111190 commented 11 years ago

now with the code as follow, I'm getting the error:

$PREBUILT/bin/$EABIARCH-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname $SONAME -shared -nostdlib  -z noexecstack -Bsymbolic --whole-archive --no-undefined -o $OUT_LIBRARY -lavcodec -lavformat -lavresample -lavutil -lswresample -lass -lfreetype -lfribidi -lswscale -lvo-aacenc -lvo-amrwbenc -lc -lm -lz -ldl -llog  --warn-once  --dynamic-linker=/system/bin/linker -zmuldefs $PREBUILT/lib/gcc/$EABIARCH/4.8/libgcc.a || exit 1
/home/ademar/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-ld: --warn-once: unknown option
/home/ademar/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-ld: use the --help option for usage information

So, looking to helper:

$ /home/ademar/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-ld --help | grep warn
  --no-enum-size-warning      (ARM only) Do not warn about objects with incompatible enum sizes
  --fatal-warnings            Treat warnings as errors
  --no-fatal-warnings         Do not treat warnings as errors
  --warn-common               Warn about duplicate common symbols
  --no-warn-common            Do not warn about duplicate common symbols (default)
  --warn-constructors         Ignored
  --no-warn-constructors      Ignored
  --warn-execstack            Warn if the stack is executable
  --no-warn-execstack         Do not warn if the stack is executable (default)
  --no-warn-mismatch          Don't warn about mismatched input files
  --warn-multiple-gp          Ignored
  --warn-search-mismatch      Warn when skipping an incompatible library
  --no-warn-search-mismatch   Don't warn when skipping an incompatible library
  --warn-shared-textrel       Warn if text segment is not shareable
  --no-warn-shared-textrel    Do not warn if text segment is not shareable (default)
  --warn-unresolved-symbols   Report unresolved symbols as warnings
  --no-wchar-size-warning     (ARM only) Do not warn about objects with incompatible wchar_t sizes

I no see the option "--warn-once", i will try wothou it, like as follow:

$PREBUILT/bin/$EABIARCH-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib  -soname $SONAME -shared -nostdlib  -z noexecstack -Bsymbolic --whole-archive --no-undefined -o $OUT_LIBRARY -lavcodec -lavformat -lavresample -lavutil -lswresample -lass -lfreetype -lfribidi -lswscale -lvo-aacenc -lvo-amrwbenc -lc -lm -lz -ldl -llog --dynamic-linker=/system/bin/linker -zmuldefs $PREBUILT/lib/gcc/$EABIARCH/4.8/libgcc.a || exit 1
Sinhbk commented 11 years ago

it seems the error occurs in ndk-r9. I downloaded ndk-r8b and it works as expecting.

kpld commented 10 years ago

I am use ndk-r9c, in build_android.sh, change "-z,noexecstack" to "-z noexecstack", and delete "--warn-once", then build OK.