From 62551b206d65bcbf30875069f994332f9f931ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 18 Feb 2015 21:36:54 -0700 Subject: [PATCH 1/3] Add rpath patch The patch adds @@ARTIFACT@@ at the proper place in the source code and we then replace it for ${ARTIFACT} using sed. --- pkgs/gcc/gcc.yaml | 13 +++++++++++++ pkgs/gcc/rpath.patch | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/gcc/rpath.patch diff --git a/pkgs/gcc/gcc.yaml b/pkgs/gcc/gcc.yaml index 97b68d4fd..7f6080923 100644 --- a/pkgs/gcc/gcc.yaml +++ b/pkgs/gcc/gcc.yaml @@ -12,6 +12,19 @@ sources: url: http://ftpmirror.gnu.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2 build_stages: + - name: rpath_patch + before: rpath_sed + files: [rpath.patch] + handler: bash + bash: | + patch -up1 < _hashdist/rpath.patch + + - name: rpath_sed + before: configure + handler: bash + bash: | + sed -i "s|@@ARTIFACT@@|${ARTIFACT}|g" gcc/config/i386/gnu-user.h gcc/config/i386/gnu-user64.h + - name: link_lib64_to_lib after: install handler: bash diff --git a/pkgs/gcc/rpath.patch b/pkgs/gcc/rpath.patch new file mode 100644 index 000000000..4ed6b182e --- /dev/null +++ b/pkgs/gcc/rpath.patch @@ -0,0 +1,24 @@ +diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h +index e1163c9..dc09728 100644 +--- a/gcc/config/i386/gnu-user.h ++++ b/gcc/config/i386/gnu-user.h +@@ -79,6 +79,7 @@ along with GCC; see the file COPYING3. If not see + %{!static: \ + %{rdynamic:-export-dynamic} \ + -dynamic-linker %(dynamic_linker)} \ ++ -rpath @@ARTIFACT@@/lib \ + %{static:-static}}" + + #undef LINK_SPEC +diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h +index 1c72b41..457639b 100644 +--- a/gcc/config/i386/gnu-user64.h ++++ b/gcc/config/i386/gnu-user64.h +@@ -63,6 +63,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + %{" SPEC_32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \ + %{" SPEC_64 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \ + %{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \ ++ -rpath @@ARTIFACT@@/lib \ + %{static:-static}}" + + #undef LINK_SPEC From 0452d394e48837e64f646fa7325697e361ff64d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 18 Feb 2015 22:01:18 -0700 Subject: [PATCH 2/3] Merge the two bash blocks --- pkgs/gcc/gcc.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/gcc/gcc.yaml b/pkgs/gcc/gcc.yaml index 7f6080923..8f0273e19 100644 --- a/pkgs/gcc/gcc.yaml +++ b/pkgs/gcc/gcc.yaml @@ -13,16 +13,11 @@ sources: build_stages: - name: rpath_patch - before: rpath_sed + before: configure files: [rpath.patch] handler: bash bash: | patch -up1 < _hashdist/rpath.patch - - - name: rpath_sed - before: configure - handler: bash - bash: | sed -i "s|@@ARTIFACT@@|${ARTIFACT}|g" gcc/config/i386/gnu-user.h gcc/config/i386/gnu-user64.h - name: link_lib64_to_lib From 25130a30087cb8a16cfdfa7120cc10287d47d93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 18 Feb 2015 22:41:37 -0700 Subject: [PATCH 3/3] Add a comment explaining what the patch does --- pkgs/gcc/gcc.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/gcc/gcc.yaml b/pkgs/gcc/gcc.yaml index 8f0273e19..b64fb9862 100644 --- a/pkgs/gcc/gcc.yaml +++ b/pkgs/gcc/gcc.yaml @@ -12,6 +12,8 @@ sources: url: http://ftpmirror.gnu.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2 build_stages: + # Make gcc automatically embed RPATH to the proper libstdc++, libgfortran, + # libgcc and libquadmath libraries: - name: rpath_patch before: configure files: [rpath.patch]