Summary: | x11/pixman: LLD relocation errors on armv7 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Charlie Li <vishwin> | ||||||
Component: | Individual Port(s) | Assignee: | freebsd-x11 (Nobody) <x11> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Some People | CC: | emaste, zeising | ||||||
Priority: | --- | Keywords: | needs-qa, toolchain | ||||||
Version: | Latest | Flags: | bugzilla:
maintainer-feedback?
(x11) koobs: merge-quarterly? |
||||||
Hardware: | arm | ||||||||
OS: | Any | ||||||||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233737 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 214864 | ||||||||
Attachments: |
|
Description
Charlie Li
2018-12-03 05:00:37 UTC
Can you share full build log, preferably from poudriere as it records environment variables, make.conf contents, etc? I can't reproduce on - 12.0 armv7 (clang/lld 6): https://ptpb.pw/zgax - 13.0 armv7 (clang/lld 7): https://ptpb.pw/xFAe and so can't pkg-fallout@: - 12.0 armv7: http://www.ipv6proxy.net/go.php?u=http://beefy13.nyi.freebsd.org/data/latest-per-pkg/pixman/0.34.0/120armv7-quarterly.log - 13.0 armv7: http://www.ipv6proxy.net/go.php?u=http://beefy16.nyi.freebsd.org/data/latest-per-pkg/pixman/0.34.0/head-armv7-default.log According to src.conf(5) WITH_LLD_IS_LD is default only on armv7 (since 12.0, its first release) but not arm (v4?) or armv6. https://svnweb.freebsd.org/changeset/base/337899 It appears that despite having devel/binutils as a build dependency, clang -no-integrated-as actually uses the base binutils as. Having WITHOUT_BINUTILS set has the build falling back to the devel/binutils as, which does not emit any assembler messages like base binutils as does (lots of register alias redefinitions ignored). Looks like devel/binutils as is doing something fishy. (In reply to Charlie Li from comment #3) > It appears that despite having devel/binutils as a build dependency, clang > -no-integrated-as actually uses the base binutils as. Indeed. In bug 221814 mmel@ dropped COMPILER_PATH without making sure GNU as(1) from devel/binutils is actually used. > the devel/binutils as, which does not emit any assembler messages > like base binutils as does (lots of register alias redefinitions ignored). Agree. Those warnings are worth fixing. > Looks like devel/binutils as is doing something fishy. I'm not sure. When adding -Wl,-z,notext the error message changes /usr/bin/ld: error: ./.libs/libpixman-arm-simd.a(pixman-arm-simd-asm-scaled.o):(.text+0x1B8): unrecognized reloc 40 which suggests there maybe a bug in LLD. A commit references this bug: Author: jbeich Date: Mon Dec 3 10:47:50 UTC 2018 New revision: 486510 URL: https://svnweb.freebsd.org/changeset/ports/486510 Log: x11/pixman: actually use GNU as from devel/binutils ./pixman-arm-simd-asm.h:695: Warning: ignoring redefinition of register alias 'wk4' ./pixman-arm-neon-asm.h:941: Warning: ignoring redefinition of register alias 'dst_w' ./pixman-arm-neon-asm.h:702: Warning: ignoring redefinition of register alias 'orig_w' pixman-arm-neon-asm-bilinear.S:612: Warning: ignoring redefinition of register alias 'top' PR: 221814 233740 Reported by: Charlie Li Approved by: portmgr blanket Changes: head/x11/pixman/Makefile A commit references this bug: Author: jbeich Date: Mon Dec 3 10:48:06 UTC 2018 New revision: 486511 URL: https://svnweb.freebsd.org/changeset/ports/486511 Log: x11/pixman: mark as LLD_UNSAFE /usr/bin/ld: error: can't create dynamic relocation R_ARM_V4BX against local symbol in readonly segment; recompile object files with -fPIC >>> defined in ./.libs/libpixman-arm-simd.a(pixman-arm-simd-asm-scaled.o) >>> referenced by pixman-arm-simd-asm-scaled.o:(.text+0x1B8) in archive ./.libs/libpixman-arm-simd.a PR: 233740 Reported by: Charlie Li Approved by: portmgr blanket Changes: head/x11/pixman/Makefile The error from LLD comes from linking non-PIC asm into a shared object. A possible workaround is to add -Wl,-znotext to LDFLAGS instead of setting LLD_UNSAFE, which allows relocations in readonly segments (which GNU ld does by default). (In reply to Ed Maste from comment #7) LDFLAGS+=-Wl,z,notext still does not work with port binutils as(1), as shown in comment 4. (In reply to Charlie Li from comment #8) Indeed, sorry I missed that. > unrecognized reloc 40 Interesting that lld reports the offending relocation (R_ARM_V4BX) w/o -znotext, but just 'reloc 40' with. If convenient can you set LLD_REPRODUCE=pixman.tar in the environment and try building the failing case? That will leave a reproduction tarball behind that can be used to further investigate lld's handling of this. (In reply to Jan Beich from comment #2) > According to src.conf(5) WITH_LLD_IS_LD is default only on armv7 (since 12.0, > its first release) but not arm (v4?) or armv6. Indeed - arm (v4/v5) and armv6 need some additional support in lld that arrived after the 6.0 release. Once we have Clang & lld 7.0 in the tree we should be able to test with WITH_LLD_IS_LD for arm & armv6 as well. Created attachment 201509 [details] LLD_REPRODUCE output from /head@342597 snapshot (In reply to Ed Maste from comment #9) > If convenient can you set LLD_REPRODUCE=pixman.tar ... LLD 8.0 is not affected but if clang800-import doesn't make it into FreeBSD 11.3/12.1 ... stable/11 and stable/12 have received Clang/LLVM updates - is this resolved now? This is believed to be fixed in currently supported versions of FreeBSD. Please re-open the PR if this is still an issue. |