Skip to content

Commit 62551b2

Browse files
committed
Add rpath patch
The patch adds @@artifact@@ at the proper place in the source code and we then replace it for ${ARTIFACT} using sed.
1 parent 5a4feee commit 62551b2

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

pkgs/gcc/gcc.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ sources:
1212
url: http://ftpmirror.gnu.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2
1313

1414
build_stages:
15+
- name: rpath_patch
16+
before: rpath_sed
17+
files: [rpath.patch]
18+
handler: bash
19+
bash: |
20+
patch -up1 < _hashdist/rpath.patch
21+
22+
- name: rpath_sed
23+
before: configure
24+
handler: bash
25+
bash: |
26+
sed -i "s|@@ARTIFACT@@|${ARTIFACT}|g" gcc/config/i386/gnu-user.h gcc/config/i386/gnu-user64.h
27+
1528
- name: link_lib64_to_lib
1629
after: install
1730
handler: bash

pkgs/gcc/rpath.patch

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
2+
index e1163c9..dc09728 100644
3+
--- a/gcc/config/i386/gnu-user.h
4+
+++ b/gcc/config/i386/gnu-user.h
5+
@@ -79,6 +79,7 @@ along with GCC; see the file COPYING3. If not see
6+
%{!static: \
7+
%{rdynamic:-export-dynamic} \
8+
-dynamic-linker %(dynamic_linker)} \
9+
+ -rpath @@ARTIFACT@@/lib \
10+
%{static:-static}}"
11+
12+
#undef LINK_SPEC
13+
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
14+
index 1c72b41..457639b 100644
15+
--- a/gcc/config/i386/gnu-user64.h
16+
+++ b/gcc/config/i386/gnu-user64.h
17+
@@ -63,6 +63,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
18+
%{" SPEC_32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \
19+
%{" SPEC_64 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \
20+
%{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \
21+
+ -rpath @@ARTIFACT@@/lib \
22+
%{static:-static}}"
23+
24+
#undef LINK_SPEC

0 commit comments

Comments
 (0)