> ../gcc_mainline/configure --target=i686-linux-android --disable-bootstrap --enable-languages=c,c++ --with-sysroot=[..]ndk/android-ndk-r9d/platforms/android-19/arch-x86 --disable-shared --disable-libitm --disable-libsanitizer > make [..] ../../../gcc_mainline/libcilkrts/runtime/os-unix.c: In function ‘linux_gettid’: ../../../gcc_mainline/libcilkrts/runtime/os-unix.c:293:20: error: ‘SYS_gettid’ undeclared (first use in this function) return syscall(SYS_gettid); ^ ../../../gcc_mainline/libcilkrts/runtime/os-unix.c:293:20: note: each undeclared identifier is reported only once for each function it appears in ../../../gcc_mainline/libcilkrts/runtime/os-unix.c: In function ‘__cilkrts_yield’: ../../../gcc_mainline/libcilkrts/runtime/os-unix.c:419:5: warning: implicit declaration of function ‘pthread_yield’ [-Wimplicit-function-declaration] pthread_yield(); ^ make[2]: *** [os-unix.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... mv -f .deps/spin_mutex.Tpo .deps/spin_mutex.Plo mv -f .deps/worker_mutex.Tpo .deps/worker_mutex.Plo mv -f .deps/stats.Tpo .deps/stats.Plo mv -f .deps/signal_node.Tpo .deps/signal_node.Plo mv -f .deps/symbol_test.Tpo .deps/symbol_test.Plo mv -f .deps/sysdep-unix.Tpo .deps/sysdep-unix.Plo make[2]: Leaving directory `/export/users/aivchenk/src/android_gcc_obj/i686-linux-android/libcilkrts' make[1]: *** [all-target-libcilkrts] Error 2 make[1]: Leaving directory `/export/users/aivchenk/src/android_gcc_obj' make: *** [all] Error 2
If SYS_gettid is not defined, then it is a bug in the bionic libc headers as NR_gettid is defined in the kernel headers. Also pthread_yield should be defined in pthread.h if it is not then it is again a bug in bionic. For no you can use --disable-libcilkrts as a workaround for bionic being broken.
Well pthread_yield should be replaced with the POSIX version: sched_yield() instead.
Created attachment 32443 [details] Renaming ANDROID to __ANDROID__
That (In reply to Andrew Pinski from comment #2) > Well pthread_yield should be replaced with the POSIX version: sched_yield() > instead. Right.. the attached patch cured the build
Patches (once tested) should be posted to gcc-patches. Please CC Balaji.
i686-pc-linux-android is not primary/secondary.
The fix in gcc-patches: http://gcc.gnu.org/ml/gcc-patches/2014-03/msg01428.html
Author: bviyer Date: Fri Apr 11 19:56:42 2014 New Revision: 209324 URL: http://gcc.gnu.org/viewcvs?rev=209324&root=gcc&view=rev Log: Fix for PR other/60644. +2014-04-11 Barry Tannenbaum <barry.m.tannenbaum@intel.com> + + PR other/60644 + * runtime/os-unix.c: Replaced all occurrances of ANDROID with + __ANDROID__. + * runtime/bug.h: Likewise. + * include/cilk/metaprogramming.h: Likewise. + * include/cilk/reducer_min_max.h: Likewise. + Modified: trunk/libcilkrts/ChangeLog trunk/libcilkrts/include/cilk/metaprogramming.h trunk/libcilkrts/include/cilk/reducer_min_max.h trunk/libcilkrts/runtime/bug.h trunk/libcilkrts/runtime/os-unix.c
Confirm fixing
Author: kyukhin Date: Thu Apr 17 11:52:44 2014 New Revision: 209474 URL: http://gcc.gnu.org/viewcvs?rev=209474&root=gcc&view=rev Log: libcilkrts/ PR other/60644 * runtime/os-unix.c: Replaced all occurrances of ANDROID with __ANDROID__. * runtime/bug.h: Likewise. * include/cilk/metaprogramming.h: Likewise. * include/cilk/reducer_min_max.h: Likewise. Modified: branches/gcc-4_9-branch/libcilkrts/ChangeLog branches/gcc-4_9-branch/libcilkrts/include/cilk/metaprogramming.h branches/gcc-4_9-branch/libcilkrts/include/cilk/reducer_min_max.h branches/gcc-4_9-branch/libcilkrts/runtime/bug.h branches/gcc-4_9-branch/libcilkrts/runtime/os-unix.c
GCC 4.9.0 has been released
GCC 4.9.1 has been released.
GCC 4.9.2 has been released.
GCC 4.9.3 has been released.
Fixed and backported to the release branch nearly 2 years ago.
Fixed on the trunk & release branch nearly 2 years ago.