summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorGustavo Zacarias <gustavo@zacarias.com.ar>2011-05-02 15:16:41 -0300
committerPeter Korsgaard <jacmet@sunsite.dk>2011-05-02 21:15:50 +0200
commit0073143087989caf4e4406a9ee3c80097684c9f3 (patch)
treefed2d091fafe3f5ad917003138c8b2557e7ed8f2 /toolchain
parent0a2af382bbc11d6fd787c247b0384faee91f8f9f (diff)
toolchain/gcc: add openmp support option
Add OpenMP support in gcc as an option instead of dynamically enabling it when threads are present. Also fix it up since we never installed libgomp to the target or staging thus it was never really functional. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/gcc/Config.in6
-rw-r--r--toolchain/gcc/gcc-uclibc-4.x.mk17
2 files changed, 22 insertions, 1 deletions
diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in
index fcdcc198c..437b86bb7 100644
--- a/toolchain/gcc/Config.in
+++ b/toolchain/gcc/Config.in
@@ -109,3 +109,9 @@ config BR2_GCC_ENABLE_TLS
help
Enable the compiler to generate code for accessing
thread local storage variables
+
+config BR2_GCC_ENABLE_OPENMP
+ bool "Enable compiler OpenMP support"
+ depends on !BR2_PTHREADS_NONE && !BR2_avr32
+ help
+ Enable OpenMP support for the compiler
diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk
index 568aa1a84..9b8bf685c 100644
--- a/toolchain/gcc/gcc-uclibc-4.x.mk
+++ b/toolchain/gcc/gcc-uclibc-4.x.mk
@@ -147,6 +147,12 @@ else
GCC_SHARED_LIBGCC:=--disable-shared
endif
+ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
+GCC_ENABLE_OPENMP:=--enable-libgomp
+else
+GCC_ENABLE_OPENMP:=--disable-libgomp
+endif
+
ifeq ($(BR2_GCC_ENABLE_TLS),y)
GCC_TLS:=--enable-tls
else
@@ -154,7 +160,7 @@ GCC_TLS:=--disable-tls
endif
ifeq ($(BR2_PTHREADS_NONE),y)
-THREADS:=--disable-threads --disable-libgomp
+THREADS:=--disable-threads
else
THREADS:=--enable-threads
endif
@@ -234,6 +240,7 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
--disable-__cxa_atexit \
$(GCC_OPTSPACE) \
$(GCC_QUADMATH) \
+ $(GCC_ENABLE_OPENMP) \
--with-gnu-ld \
--disable-shared \
--disable-libssp \
@@ -301,6 +308,7 @@ $(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched
--disable-__cxa_atexit \
$(GCC_OPTSPACE) \
$(GCC_QUADMATH) \
+ $(GCC_ENABLE_OPENMP) \
--with-gnu-ld \
--enable-shared \
--disable-libssp \
@@ -379,6 +387,7 @@ $(GCC_BUILD_DIR3)/.configured: $(GCC_SRC_DIR)/.patched $(GCC_STAGING_PREREQ)
--disable-__cxa_atexit \
$(GCC_OPTSPACE) \
$(GCC_QUADMATH) \
+ $(GCC_ENABLE_OPENMP) \
--with-gnu-ld \
--disable-libssp \
--disable-multilib \
@@ -470,6 +479,11 @@ ifeq ($(BR2_INSTALL_LIBGCJ),y)
$(TARGET_DIR)/usr/lib/security/
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libgcj.so*
endif
+ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
+ cp -dpf $(HOST_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libgomp.so* $(STAGING_DIR)/usr/lib/
+ cp -dpf $(HOST_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libgomp.so* $(TARGET_DIR)/usr/lib/
+ -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libgomp.so*
+endif
mkdir -p $(@D)
touch $@
@@ -523,6 +537,7 @@ $(GCC_BUILD_DIR4)/.configured: $(GCC_BUILD_DIR4)/.prepared
--disable-__cxa_atexit \
$(GCC_OPTSPACE) \
$(GCC_QUADMATH) \
+ $(GCC_ENABLE_OPENMP) \
--with-gnu-ld \
--disable-libssp \
--disable-multilib \