diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2019-04-18 09:38:50 +0000 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2019-04-18 09:55:22 +0000 |
commit | 07784245c1822766d54405d835ac2dc08652df1a (patch) | |
tree | ca47c014cd6762db559002b7943c11bcb5f670b7 | |
parent | 4303873091a860ce3f6dd8299f36ae7675ad716f (diff) | |
download | meta-qt5-07784245c1822766d54405d835ac2dc08652df1a.tar.gz |
qtbase: disable gold for all archs not just x86
* enabling xlib in x86_64 build was failing with:
ERROR: Feature 'xcb-xlib' was enabled, but the pre-condition 'features.xlib && libs.xcb_xlib' failed.
* the root cause is linking with full path libm.so in my case:
/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/qtbase/5.12.3+gitAUTOINC+b527725766-r0/recipe-sysroot/usr/lib/libm.so
which with gold fails with:
/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/qtbase/5.12.3+gitAUTOINC+b527725766-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/8.3.0/ld: error: cannot open /lib/libm.so.6: No such file or directory
/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/qtbase/5.12.3+gitAUTOINC+b527725766-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/8.3.0/ld: error: cannot open /usr/lib/libmvec_nonshared.a: No such file or directory
/OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/qtbase/5.12.3+gitAUTOINC+b527725766-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/../../libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/8.3.0/ld: error: cannot open /lib/libmvec.so.1: No such file or directory
collect2: error: ld returned 1 exit status
* not linking with libm at all in xcb test makes it pass, or linking
with -lm as before works as well, but to be safe lets disable gold
everywhere until it's resolved in upstream Qt
* also reported in the 5.12.2 upgrade PR:
https://github.com/meta-qt5/meta-qt5/pull/181#issuecomment-484425112
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r-- | recipes-qt/qt5/qtbase_git.bb | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb index 56db29b2..9985ee20 100644 --- a/recipes-qt/qt5/qtbase_git.bb +++ b/recipes-qt/qt5/qtbase_git.bb | |||
@@ -37,28 +37,6 @@ SRC_URI += "\ | |||
37 | # for syncqt | 37 | # for syncqt |
38 | RDEPENDS_${PN}-tools += "perl" | 38 | RDEPENDS_${PN}-tools += "perl" |
39 | 39 | ||
40 | # workaround for gold bug: | ||
41 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842304 | ||
42 | # https://sourceware.org/bugzilla/show_bug.cgi?id=21712 | ||
43 | # it's triggered only in combination of gold and security_flags.inc, | ||
44 | # because security_flags.inc now enable pie by default. | ||
45 | # Adding -no-pie or changing -fuse-ld=gold to -fuse-ld=bfd | ||
46 | # works around this issue, will use -fuse-ld=bfd as it's considered | ||
47 | # binutils bug. | ||
48 | # OE @ ~/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/tests/auto/corelib/kernel/qmetatype $ i586-oe-linux-g++ -m32 -march=i586 --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -o tst_qmetatype .obj/tst_qmetatype.o -L/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/lib -lQt5Test -lQt5Core -lpthread | ||
49 | # .obj/tst_qmetatype.o(.qtversion+0x0): error: unexpected reloc 3 against global symbol qt_version_tag without base register in object file when generating a position-independent output file | ||
50 | # collect2: error: ld returned 1 exit status | ||
51 | # | ||
52 | # with -no-pie: | ||
53 | # OE @ ~/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/tests/auto/corelib/kernel/qmetatype $ i586-oe-linux-g++ -no-pie -m32 -march=i586 --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -o tst_qmetatype .obj/tst_qmetatype.o -L/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/lib -lQt5Test -lQt5Core -lpthread | ||
54 | # | ||
55 | # with -fuse-ld=gold replaced with -fuse-ld=bfd: | ||
56 | # OE @ ~/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/tests/auto/corelib/kernel/qmetatype $ i586-oe-linux-g++ -m32 -march=i586 --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -fuse-ld=bfd -Wl,--enable-new-dtags -o tst_qmetatype .obj/tst_qmetatype.o -L/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/lib -lQt5Test -lQt5Core -lpthread | ||
57 | # | ||
58 | # http://errors.yoctoproject.org/Errors/Details/150329/ | ||
59 | QT_CONFIG_FLAGS_GOLD_x86 = "-no-use-gold-linker" | ||
60 | LDFLAGS_append_x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" | ||
61 | |||
62 | # separate some parts of PACKAGECONFIG which are often changed | 40 | # separate some parts of PACKAGECONFIG which are often changed |
63 | PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gl', '', d)}" | 41 | PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gl', '', d)}" |
64 | PACKAGECONFIG_FB ?= "${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)}" | 42 | PACKAGECONFIG_FB ?= "${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)}" |
@@ -159,6 +137,38 @@ PACKAGECONFIG[journald] = "-journald,-no-journald,systemd" | |||
159 | PACKAGECONFIG[getentropy] = "-feature-getentropy,-no-feature-getentropy," | 137 | PACKAGECONFIG[getentropy] = "-feature-getentropy,-no-feature-getentropy," |
160 | 138 | ||
161 | QT_CONFIG_FLAGS_GOLD = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '-use-gold-linker', '-no-use-gold-linker', d)}" | 139 | QT_CONFIG_FLAGS_GOLD = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '-use-gold-linker', '-no-use-gold-linker', d)}" |
140 | # workaround for gold bug: | ||
141 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=842304 | ||
142 | # https://sourceware.org/bugzilla/show_bug.cgi?id=21712 | ||
143 | # it's triggered only in combination of gold and security_flags.inc, | ||
144 | # because security_flags.inc now enable pie by default. | ||
145 | # Adding -no-pie or changing -fuse-ld=gold to -fuse-ld=bfd | ||
146 | # works around this issue, will use -fuse-ld=bfd as it's considered | ||
147 | # binutils bug. | ||
148 | # OE @ ~/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/tests/auto/corelib/kernel/qmetatype $ i586-oe-linux-g++ -m32 -march=i586 --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -o tst_qmetatype .obj/tst_qmetatype.o -L/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/lib -lQt5Test -lQt5Core -lpthread | ||
149 | # .obj/tst_qmetatype.o(.qtversion+0x0): error: unexpected reloc 3 against global symbol qt_version_tag without base register in object file when generating a position-independent output file | ||
150 | # collect2: error: ld returned 1 exit status | ||
151 | # | ||
152 | # with -no-pie: | ||
153 | # OE @ ~/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/tests/auto/corelib/kernel/qmetatype $ i586-oe-linux-g++ -no-pie -m32 -march=i586 --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -o tst_qmetatype .obj/tst_qmetatype.o -L/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/lib -lQt5Test -lQt5Core -lpthread | ||
154 | # | ||
155 | # with -fuse-ld=gold replaced with -fuse-ld=bfd: | ||
156 | # OE @ ~/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/tests/auto/corelib/kernel/qmetatype $ i586-oe-linux-g++ -m32 -march=i586 --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/recipe-sysroot -Wl,-O1 -fuse-ld=bfd -Wl,--enable-new-dtags -o tst_qmetatype .obj/tst_qmetatype.o -L/OE/build/oe-core/tmp-glibc/work/i586-oe-linux/qtbase/5.9.0+gitAUTOINC+f6b36eaafe-r0/build/lib -lQt5Test -lQt5Core -lpthread | ||
157 | # | ||
158 | # http://errors.yoctoproject.org/Errors/Details/150329/ | ||
159 | # QT_CONFIG_FLAGS_GOLD_x86 = "-no-use-gold-linker" | ||
160 | # LDFLAGS_append_x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" | ||
161 | |||
162 | # since the upgrade to 5.12.2 this got worse, with gold enabled configure will no longer pass the test for xlib | ||
163 | # because with full paths to libraries since qtbase commit 521a85395 it fails to link with | ||
164 | # /OE/build/oe-core/tmp-glibc/work/core2-64-oe-linux/qtbase/5.12.3+gitAUTOINC+b527725766-r0/recipe-sysroot/usr/lib/libm.so | ||
165 | # as reported in: | ||
166 | # https://github.com/meta-qt5/meta-qt5/pull/181#issuecomment-484425112 | ||
167 | # resulting in do_configure failure: | ||
168 | # http://errors.yoctoproject.org/Errors/Details/237856/ | ||
169 | QT_CONFIG_FLAGS_GOLD = "-no-use-gold-linker" | ||
170 | LDFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" | ||
171 | |||
162 | QT_CONFIG_FLAGS += " \ | 172 | QT_CONFIG_FLAGS += " \ |
163 | ${QT_CONFIG_FLAGS_GOLD} \ | 173 | ${QT_CONFIG_FLAGS_GOLD} \ |
164 | -shared \ | 174 | -shared \ |