From 84c92287b6ce0965df488c79ab2b190b2631614f Mon Sep 17 00:00:00 2001 From: Sven Peter Date: Fri, 22 Jul 2016 13:37:26 +0200 Subject: [PATCH 1/3] gcc-4.8: add library paths reported by system linker Right now only part of the system's libc is symlinked into the conda env - namely the startup files crtXXX.o. In addition the path to the actual shared object libc.so also needs to be added to the spec file in case a custom linker is used inside the conda env (e.g. because binutils is requested). --- gcc-4.8/post-link.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc-4.8/post-link.sh b/gcc-4.8/post-link.sh index bbf2ec3ac..a07bd4b9f 100644 --- a/gcc-4.8/post-link.sh +++ b/gcc-4.8/post-link.sh @@ -111,6 +111,13 @@ else # ... yada yada ... -isystem ${INCDIR} sed -i ':a;N;$!ba;s|\(*cpp:\n[^\n]*\)|\1 -isystem '${INCDIR}'|g' "${SPECS_FILE}" done + + # + # Linux Portability Issue #2.5: linker also needs to find the rest of libc (i.e. libc.so in addition to crtXXX.o) + # + for library_path in $(/usr/bin/ld --verbose | grep SEARCH_DIR | sed -r 's/SEARCH_DIR\("=?([^"]*)"\);/ \1/g'); do + sed -i ':a;N;$!ba;s|\(*link_libgcc:\n[^\n]*\)|\1 -L'${library_path}'|g' "${SPECS_FILE}" + done fi ## TEST: Here we verify that gcc can build a simple "Hello world" program for both C and C++. From c526ef8b735f968428a2287c8d8bd620029dcba7 Mon Sep 17 00:00:00 2001 From: Sven Peter Date: Mon, 25 Jul 2016 10:37:36 +0200 Subject: [PATCH 2/3] gcc-4.8: use system linker to find SEARCH_DIRs --- gcc-4.8/post-link.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc-4.8/post-link.sh b/gcc-4.8/post-link.sh index a07bd4b9f..a9b3cc644 100644 --- a/gcc-4.8/post-link.sh +++ b/gcc-4.8/post-link.sh @@ -46,7 +46,7 @@ else c_runtime_obj_files_found=0 # Try locating crtXXX.o in default library search paths - for library_path in $(ld --verbose | grep SEARCH_DIR | sed -r 's/SEARCH_DIR\("=?([^"]*)"\);/ \1/g'); do + for library_path in $(/usr/bin/ld --verbose | grep SEARCH_DIR | sed -r 's/SEARCH_DIR\("=?([^"]*)"\);/ \1/g'); do for obj_file in $C_RUNTIME_OBJ_FILES; do obj_file_full_path="$library_path/$obj_file" if [[ -e "$obj_file_full_path" ]]; then From bbdf206b0ae97f2233e1710c5186f5031a5b9421 Mon Sep 17 00:00:00 2001 From: Sven Peter Date: Mon, 25 Jul 2016 10:38:03 +0200 Subject: [PATCH 3/3] gcc-4.8: bump build version --- gcc-4.8/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc-4.8/meta.yaml b/gcc-4.8/meta.yaml index dab1af55a..e4e4dce28 100644 --- a/gcc-4.8/meta.yaml +++ b/gcc-4.8/meta.yaml @@ -13,7 +13,7 @@ source: # along with using ${GCC_PREFIX}/.. fixes the issues with our configuration. build: detect_binary_files_with_prefix: false - number: 6 + number: 7 requirements: build: