Bug 216908 - security/gnutls: does not build on 12-CURRENT aarch64 after llvm 3.9 toolchain integration
Summary: security/gnutls: does not build on 12-CURRENT aarch64 after llvm 3.9 toolchai...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-08 10:30 UTC by Wolfgang Meyer
Modified: 2017-02-15 15:20 UTC (History)
3 users (show)

See Also:
emaste: mfc-stable11+
emaste: mfc-stable10-
emaste: mfc-stable9-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Meyer 2017-02-08 10:30:46 UTC
Not sure whether to report this as individual ports bug or base system bug.

The security/gnutls ports does not build on 12-CURRENT aarch64 (poudriere build with qemu-user-static) after updating the llvm toolchain to version 3.9.0 ( base r309124 ). The newly added lld linker seems to be the culprit giving an linker error (complete logfile in attachment):

libtool: link: c++ -shared -nostdlib /usr/lib/crti.o /usr/lib/crtbeginS.o  .libs/libgnutlsxx_la-gnutlsxx.o   ./.libs/libgnutls.so -lintl -L/usr/local/lib -L/usr/lib -lc++ -lm -lc -lgcc -lgcc_s /usr/lib/crtendS.o /usr/lib/crtn.o  -O2   -o .libs/libgnutlsxx.so.28.1.0
CIE code alignment must be 1
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[5]: *** [Makefile:1729: libgnutlsxx.la] Error 1
gmake[5]: Leaving directory '/wrkdirs/usr/ports/security/gnutls/work/gnutls-3.5.8/lib'
gmake[4]: *** [Makefile:1940: all-recursive] Error 1
gmake[4]: Leaving directory '/wrkdirs/usr/ports/security/gnutls/work/gnutls-3.5.8/lib'
gmake[3]: *** [Makefile:1629: all] Error 2
gmake[3]: Leaving directory '/wrkdirs/usr/ports/security/gnutls/work/gnutls-3.5.8/lib'
gmake[2]: *** [Makefile:1460: all-recursive] Error 1
gmake[2]: Leaving directory '/wrkdirs/usr/ports/security/gnutls/work/gnutls-3.5.8'
gmake[1]: *** [Makefile:1388: all] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/security/gnutls/work/gnutls-3.5.8'
*** Error code 1

Workaround:
Patching lld with http://llvm.org/viewvc/llvm-project?view=revision&revision=277105 from llvm upstream fixes the linker error (the patch is not backported to the llvm 3.9 branch yet).
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2017-02-08 13:40:19 UTC
I wasn't aware that lld was used by default for aarch64, I thought this used an external binutils port based ld instead?

But in any case, @Ed, upstream r277105 seems like a relatively safe one to import into 3.9 as we have it now in head and stable/11?
Comment 2 Ed Maste freebsd_committer freebsd_triage 2017-02-08 14:03:24 UTC
(In reply to Dimitry Andric from comment #1)
> I wasn't aware that lld was used by default for aarch64, I thought this used
> an external binutils port based ld instead?

buildworld and buildkernel use the binutils ld by default, but as of 3.9 we have added LLD by default so a linker is available in the base system.

> But in any case, @Ed, upstream r277105 seems like a relatively safe one to
> import into 3.9 as we have it now in head and stable/11?

I agree, it should be safe for us (although upstream is unlikely to backport it).
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-02-08 20:32:53 UTC
A commit references this bug:

Author: emaste
Date: Wed Feb  8 20:31:54 UTC 2017
New revision: 313458
URL: https://svnweb.freebsd.org/changeset/base/313458

Log:
  lld: Allow arbitrary code alignment in .eh_frame

  According to the specification, CIE code alignment factor is an
  arbitrary unsigned LEB128 encoded value.

  PR:		216908
  Reported by:	Wolfgang Meyer
  Obtained from:	Upstream LLD r277105
  MFC after:	1 week

Changes:
  head/contrib/llvm/tools/lld/ELF/EhFrame.cpp
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-02-15 15:19:41 UTC
A commit references this bug:

Author: emaste
Date: Wed Feb 15 15:18:44 UTC 2017
New revision: 313773
URL: https://svnweb.freebsd.org/changeset/base/313773

Log:
  MFC r313458: lld: Allow arbitrary code alignment in .eh_frame

  According to the specification, CIE code alignment factor is an
  arbitrary unsigned LEB128 encoded value.

  PR:		216908

Changes:
_U  stable/11/
  stable/11/contrib/llvm/tools/lld/ELF/EhFrame.cpp