From b6e375800c9a2f02a732cbdf5e87a860c3d954e1 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Thu, 27 Dec 2012 09:14:35 +0800 Subject: Fix OpenMP Based on 1271761f530c0050154e8d526b95f952df551751, 92c478dba755a1a2f6f00ff390666acbffd41982, and 51df2e98d22e2c6f5d2a16860bc8fc3644179c1d. With the following modifications: 1. Translate -pthread to -lc instead of -lpthread Android doesn't have (has pthread* in libc.so instead) 2. Because of 1., we can restore to the original order of LINUX_OR_ANDROID_LD Change-Id: I505250c32b9908cb17bb269dc26e73c91669c07f --- gcc-4.6/gcc/config/arm/linux-eabi.h | 2 +- gcc-4.6/gcc/config/gnu-user.h | 8 +++++--- gcc-4.6/gcc/config/i386/linux.h | 2 +- gcc-4.6/gcc/config/i386/linux64.h | 2 +- gcc-4.6/gcc/config/linux-android.h | 4 ++-- gcc-4.6/gcc/config/mips/linux.h | 8 +++++--- 6 files changed, 15 insertions(+), 11 deletions(-) (limited to 'gcc-4.6') diff --git a/gcc-4.6/gcc/config/arm/linux-eabi.h b/gcc-4.6/gcc/config/arm/linux-eabi.h index bb1a681cd..19e49054c 100644 --- a/gcc-4.6/gcc/config/arm/linux-eabi.h +++ b/gcc-4.6/gcc/config/arm/linux-eabi.h @@ -87,7 +87,7 @@ #undef LIB_SPEC #define LIB_SPEC \ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \ - ANDROID_LIB_SPEC " " GNU_USER_TARGET_LIB_SPEC ) + GNU_USER_TARGET_LIB_SPEC_LESS_PTHREAD " " ANDROID_LIB_SPEC) #undef STARTFILE_SPEC #define STARTFILE_SPEC \ diff --git a/gcc-4.6/gcc/config/gnu-user.h b/gcc-4.6/gcc/config/gnu-user.h index 1c4e71d1b..703afb5c7 100644 --- a/gcc-4.6/gcc/config/gnu-user.h +++ b/gcc-4.6/gcc/config/gnu-user.h @@ -74,10 +74,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" -#define GNU_USER_TARGET_LIB_SPEC \ - "%{pthread:-lpthread} \ - %{shared:-lc} \ +#define GNU_USER_TARGET_LIB_SPEC_LESS_PTHREAD \ + "%{shared:-lc} \ %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}" +#define GNU_USER_TARGET_LIB_SPEC \ + "%{pthread:-lpthread} " \ + GNU_USER_TARGET_LIB_SPEC_LESS_PTHREAD #undef LIB_SPEC #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC diff --git a/gcc-4.6/gcc/config/i386/linux.h b/gcc-4.6/gcc/config/i386/linux.h index 57a8758aa..4bf4a45c9 100644 --- a/gcc-4.6/gcc/config/i386/linux.h +++ b/gcc-4.6/gcc/config/i386/linux.h @@ -142,7 +142,7 @@ along with GCC; see the file COPYING3. If not see #undef LIB_SPEC #define LIB_SPEC \ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \ - GNU_USER_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC) + GNU_USER_TARGET_LIB_SPEC_LESS_PTHREAD " " ANDROID_LIB_SPEC) #undef STARTFILE_SPEC #define STARTFILE_SPEC \ diff --git a/gcc-4.6/gcc/config/i386/linux64.h b/gcc-4.6/gcc/config/i386/linux64.h index 96c839000..c72177818 100644 --- a/gcc-4.6/gcc/config/i386/linux64.h +++ b/gcc-4.6/gcc/config/i386/linux64.h @@ -103,7 +103,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef LIB_SPEC #define LIB_SPEC \ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \ - GNU_USER_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC) + GNU_USER_TARGET_LIB_SPEC_LESS_PTHREAD " " ANDROID_LIB_SPEC) #undef STARTFILE_SPEC #define STARTFILE_SPEC \ diff --git a/gcc-4.6/gcc/config/linux-android.h b/gcc-4.6/gcc/config/linux-android.h index c6d9cddb9..c19b1c13d 100644 --- a/gcc-4.6/gcc/config/linux-android.h +++ b/gcc-4.6/gcc/config/linux-android.h @@ -53,8 +53,8 @@ "--noexecstack" #define ANDROID_LIB_SPEC \ - "%{!static: -ldl}" \ - "%{pthread:-lc}" + "%{!static: -ldl} \ + %{pthread: -lc}" #define ANDROID_STARTFILE_SPEC \ "%{shared: crtbegin_so%O%s;:" \ diff --git a/gcc-4.6/gcc/config/mips/linux.h b/gcc-4.6/gcc/config/mips/linux.h index 7a292bfd6..6104463c4 100644 --- a/gcc-4.6/gcc/config/mips/linux.h +++ b/gcc-4.6/gcc/config/mips/linux.h @@ -102,11 +102,13 @@ along with GCC; see the file COPYING3. If not see #undef ASM_OUTPUT_REG_POP #undef LINUX_SUBTARGET_LIB_SPEC -#define LINUX_SUBTARGET_LIB_SPEC "\ -%{pthread:-lpthread} \ +#define LINUX_SUBTARGET_LIB_SPEC_LESS_PTHREAD "\ %{shared:-lc} \ %{!shared: \ %{profile:-lc_p} %{!profile:-lc}}" +#define LINUX_SUBTARGET_LIB_SPEC "\ +%{pthread:-lpthread} " \ +LINUX_SUBTARGET_LIB_SPEC_LESS_PTHREAD #define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h" @@ -168,7 +170,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #undef LIB_SPEC #define LIB_SPEC \ LINUX_OR_ANDROID_LD (LINUX_SUBTARGET_LIB_SPEC, \ - LINUX_SUBTARGET_LIB_SPEC " " ANDROID_LIB_SPEC) + LINUX_SUBTARGET_LIB_SPEC_LESS_PTHREAD " " ANDROID_LIB_SPEC) #undef STARTFILE_SPEC #define STARTFILE_SPEC \ -- cgit v1.2.3