-
Notifications
You must be signed in to change notification settings - Fork 54
Make gcc embed rpath automatically #646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,16 @@ 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] | ||
| handler: bash | ||
| bash: | | ||
| patch -up1 < _hashdist/rpath.patch | ||
| sed -i "s|@@ARTIFACT@@|${ARTIFACT}|g" gcc/config/i386/gnu-user.h gcc/config/i386/gnu-user64.h | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line assumes that
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ahmadia I've searched the web and there doesn't seem to be any solution really to this, except to manually escape the variable to be substituted. I think it will also fail if the variable contains There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use other separator but I would assume that "|" is fairly safe for a path. It is safer than ":" which we could use if there was more than one path.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. The |
||
|
|
||
| - name: link_lib64_to_lib | ||
| after: install | ||
| handler: bash | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these two blobs can just be merged into one. I'll do it after my gcc build finishes.