1 |
commit: be92bd625289f6c2167917761dd4690cc62986d0 |
2 |
Author: Marco Leise <marco.leise <AT> gmx <DOT> de> |
3 |
AuthorDate: Fri Aug 14 19:59:19 2020 +0000 |
4 |
Commit: Marco Leise <marco.leise <AT> gmx <DOT> de> |
5 |
CommitDate: Sat Aug 15 01:34:45 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=be92bd62 |
7 |
|
8 |
Fixed an issue where ldc2 would not build with dmd, because "-Wl,--icf=safe" wasn't correctly filtered out of LDFLAGS if set. |
9 |
|
10 |
Signed-off-by: Marco Leise <marco.leise <AT> gmx.de> |
11 |
|
12 |
eclass/dlang.eclass | 37 ++++++++++++++++++------------------- |
13 |
1 file changed, 18 insertions(+), 19 deletions(-) |
14 |
|
15 |
diff --git a/eclass/dlang.eclass b/eclass/dlang.eclass |
16 |
index a8a4ace..80dea3a 100644 |
17 |
--- a/eclass/dlang.eclass |
18 |
+++ b/eclass/dlang.eclass |
19 |
@@ -207,25 +207,6 @@ dlang_compile_lib_so() { |
20 |
# Makes linker flags meant for GCC understandable for the current D compiler. |
21 |
# Basically it replaces -L with what the D compiler uses as linker prefix. |
22 |
dlang_convert_ldflags() { |
23 |
- if [[ "${DLANG_VENDOR}" == "DigitalMars" ]]; then |
24 |
- # gc-sections breaks executables for some versions of D |
25 |
- # It works with the gold linker on the other hand |
26 |
- # See: https://issues.dlang.org/show_bug.cgi?id=879 |
27 |
- [[ "${DLANG_PACKAGE_TYPE}" == "dmd" ]] && local dlang_version=$SLOT || local dlang_version=$DLANG_VERSION |
28 |
- if ver_test $dlang_version -lt 2.072; then |
29 |
- if ! ld -v | grep -q "^GNU gold"; then |
30 |
- filter-ldflags {-L,-Xlinker,-Wl,}--gc-sections |
31 |
- fi |
32 |
- fi |
33 |
- # Filter ld.gold ICF flag. (https://issues.dlang.org/show_bug.cgi?id=17515) |
34 |
- filter-ldflags {-L,-Xlinker,-Wl,}--icf={none,all,safe} |
35 |
- fi |
36 |
- |
37 |
- if [[ "${DLANG_VENDOR}" == "DigitalMars" ]] || [[ "${DLANG_VENDOR}" == "GNU" ]]; then |
38 |
- # DMD and GDC don't undestand/work with LTO flags |
39 |
- filter-ldflags -f{no-,}use-linker-plugin -f{no-,}lto -flto=* |
40 |
- fi |
41 |
- |
42 |
if [[ "${DLANG_VENDOR}" == "DigitalMars" ]] || [[ "${DLANG_VENDOR}" == "LDC" ]]; then |
43 |
local set prefix flags=() |
44 |
if [[ is_dmd ]]; then |
45 |
@@ -613,6 +594,24 @@ __dlang_use_build_vars() { |
46 |
die "Could not detect D compiler vendor!" |
47 |
fi |
48 |
# We need to convert the LDFLAGS, so they are understood by DMD and LDC. |
49 |
+ if [[ "${DLANG_VENDOR}" == "DigitalMars" ]]; then |
50 |
+ # gc-sections breaks executables for some versions of D |
51 |
+ # It works with the gold linker on the other hand |
52 |
+ # See: https://issues.dlang.org/show_bug.cgi?id=879 |
53 |
+ [[ "${DLANG_PACKAGE_TYPE}" == "dmd" ]] && local dlang_version=$SLOT || local dlang_version=$DLANG_VERSION |
54 |
+ if ver_test $dlang_version -lt 2.072; then |
55 |
+ if ! ld -v | grep -q "^GNU gold"; then |
56 |
+ filter-flags {-L,-Xlinker,-Wl\,}--gc-sections |
57 |
+ fi |
58 |
+ fi |
59 |
+ # Filter ld.gold ICF flag. (https://issues.dlang.org/show_bug.cgi?id=17515) |
60 |
+ filter-flags {-L,-Xlinker,-Wl\,}--icf={none,all,safe} |
61 |
+ fi |
62 |
+ |
63 |
+ if [[ "${DLANG_VENDOR}" == "DigitalMars" ]] || [[ "${DLANG_VENDOR}" == "GNU" ]]; then |
64 |
+ # DMD and GDC don't undestand/work with LTO flags |
65 |
+ filter-ldflags -f{no-,}use-linker-plugin -f{no-,}lto -flto=* |
66 |
+ fi |
67 |
export LDFLAGS=`dlang_convert_ldflags` |
68 |
"${@}" |
69 |
} |