Bug 60644 - [4.9/5/6 Regression] Build of i686-pc-linux-android is broken
Summary: [4.9/5/6 Regression] Build of i686-pc-linux-android is broken
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.9.0
: P4 normal
Target Milestone: 4.9.4
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-25 06:36 UTC by Alexander Ivchenko
Modified: 2016-01-31 21:23 UTC (History)
2 users (show)

See Also:
Host:
Target: i686-pc-linux-android
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Renaming ANDROID to __ANDROID__ (1.16 KB, patch)
2014-03-25 06:52 UTC, Alexander Ivchenko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Ivchenko 2014-03-25 06:36:18 UTC
> ../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
Comment 1 Andrew Pinski 2014-03-25 06:40:40 UTC
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.
Comment 2 Andrew Pinski 2014-03-25 06:44:55 UTC
Well pthread_yield should be replaced with the POSIX version: sched_yield() instead.
Comment 3 Alexander Ivchenko 2014-03-25 06:52:05 UTC
Created attachment 32443 [details]
Renaming ANDROID to __ANDROID__
Comment 4 Alexander Ivchenko 2014-03-25 06:52:36 UTC
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
Comment 5 Jakub Jelinek 2014-03-25 15:28:11 UTC
Patches (once tested) should be posted to gcc-patches.
Please CC Balaji.
Comment 6 Richard Biener 2014-03-31 09:50:14 UTC
i686-pc-linux-android is not primary/secondary.
Comment 7 Alexander Ivchenko 2014-03-31 10:02:52 UTC
The fix in gcc-patches:
http://gcc.gnu.org/ml/gcc-patches/2014-03/msg01428.html
Comment 8 bviyer 2014-04-11 19:57:14 UTC
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
Comment 9 Alexander Ivchenko 2014-04-14 07:58:30 UTC
Confirm fixing
Comment 10 Kirill Yukhin 2014-04-17 11:53:17 UTC
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
Comment 11 Jakub Jelinek 2014-04-22 11:37:05 UTC
GCC 4.9.0 has been released
Comment 12 Jakub Jelinek 2014-07-16 13:30:54 UTC
GCC 4.9.1 has been released.
Comment 13 Jakub Jelinek 2014-10-30 10:41:00 UTC
GCC 4.9.2 has been released.
Comment 14 Jakub Jelinek 2015-06-26 19:55:49 UTC
GCC 4.9.3 has been released.
Comment 15 Jeffrey A. Law 2016-01-31 21:22:32 UTC
Fixed and backported to the release branch nearly 2 years ago.
Comment 16 Jeffrey A. Law 2016-01-31 21:23:27 UTC
Fixed on the trunk & release branch nearly 2 years ago.