Bug 240918 - devel/llvm90: default to -march=i586 to avoid libatomic on i386
Summary: devel/llvm90: default to -march=i586 to avoid libatomic on i386
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brooks Davis
URL:
Keywords: patch, patch-ready
Depends on:
Blocks:
 
Reported: 2019-09-29 13:29 UTC by Jan Beich
Modified: 2019-10-28 21:05 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (brooks)
jbeich: merge-quarterly?


Attachments
v1 (5.52 KB, patch)
2019-09-29 13:29 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2019-09-29 13:29:16 UTC
Created attachment 207933 [details]
v1

Apply base r352030 to help Firefox-based ports with the following:

mozglue/misc/TimeStamp.o: In function `mozilla::TimeStamp::NowFuzzy(mozilla::TimeStamp63Bit)':
TimeStamp.cpp:(.text._ZN7mozilla9TimeStamp8NowFuzzyENS_14TimeStamp63BitE+0x22): undefined reference to `__atomic_load_8'
mozglue/misc/TimeStamp.o: In function `mozilla::TimeStamp::UpdateFuzzyTimeStamp(mozilla::TimeStamp)':
TimeStamp.cpp:(.text._ZN7mozilla9TimeStamp20UpdateFuzzyTimeStampES0_+0x28): undefined reference to `__atomic_store_8'
mozglue/misc/TimeStamp.o: In function `mozilla::TimeStamp::NowFuzzyTime()':
TimeStamp.cpp:(.text._ZN7mozilla9TimeStamp12NowFuzzyTimeEv+0x1a): undefined reference to `__atomic_load_8'
mozglue/misc/TimeStamp.o: In function `mozilla::TimeStamp::UpdateFuzzyTime(long long)':
TimeStamp.cpp:(.text._ZN7mozilla9TimeStamp15UpdateFuzzyTimeEx+0x20): undefined reference to `__atomic_store_8'
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

Builds fine:
- llvm90 on 11.2/11.3/12.0/13.0 amd64/i386
- thunderbird, firefox, firefox-esr, cliqz on 11.2 i386
Comment 1 Jan Beich freebsd_committer freebsd_triage 2019-10-04 18:45:13 UTC
(In reply to Jan Beich from comment #0)
> - thunderbird, firefox, firefox-esr, cliqz on 11.2 i386

Upstream of these doesn't support anything below -march=pentium4 but downstream lowered to -march=i686, see lang/rust/files/patch-src_librustc__target_spec_i686__unknown__freebsd.rs and https://bugzilla.mozilla.org/show_bug.cgi?id=1300843

Ignoring Gecko only 9 ports override CC/CXX to use devel/llvm90:
- comms/gnuradio (skipped due to BROKEN in comms/uhd)
- graphics/pcl-pointclouds (BROKEN, related to libatomic)
- graphics/qgis-ltr
- math/casadi
- misc/veles
- net/aluminum
- science/agrum
- science/erkale (BROKEN, related to libatomic)
- security/afl++
Comment 2 Jan Beich freebsd_committer freebsd_triage 2019-10-08 01:46:29 UTC
I do intend to land this at the end of the week per maintainer timeout. Other than LLVM_DEFAULT some users also build everything with a compiler from ports (usually, on old releases).

Let the best not be the enemy of the good.
Comment 3 Brooks Davis freebsd_committer freebsd_triage 2019-10-08 17:13:52 UTC
Please let me land this.  I'll aim to do it by the end of the week.  I'd like to roll it up with other changes to reduce the number of times people have to rebuild llvm.
Comment 4 Jan Beich freebsd_committer freebsd_triage 2019-10-09 06:02:29 UTC
Would "roll it up with other changes" prevent MFH to 2019Q4? Other than the future 9.0.1 almost everything will have low risk to go under ports-secteam blanket (reliability/regression fixes).
Comment 5 Brooks Davis freebsd_committer freebsd_triage 2019-10-09 17:22:15 UTC
(In reply to Jan Beich from comment #4)
This would be merging fixes to crashes so the sort of thing that should be MFH.
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-10-09 20:36:11 UTC
A commit references this bug:

Author: brooks
Date: Wed Oct  9 20:36:06 UTC 2019
New revision: 514194
URL: https://svnweb.freebsd.org/changeset/ports/514194

Log:
  Rollup of fixes since the 9.0.0 release.

  - Change the default -march for i386 from i486 to i586.  This avoids
    the need for libatomics and had been the defacto default for some
    time. [0]

  - Add -m(no)-spe to clang. (powerpc)

  - Deduce MIPS specific ELF header flags from `emulation`. (mips)

  - Fix a variety of assertions and compile/link errors including crashes
    with CPUTYPE=haswell. [1]

  - Switch back to https for downloads. [2]

  The new patches were initially committed to FreeBSD src by dim@.

  PR:		240918 [0], 240759 [1], 240870 [2]
  Reported by:	jbeich [0,1],  Miyashita Touka <imagin8r@protonmail.com> [2]

Changes:
  head/devel/llvm90/Makefile
  head/devel/llvm90/files/clang/patch-freebsd-r352030
  head/devel/llvm90/files/clang/patch-freebsd-r352539
  head/devel/llvm90/files/clang/patch-freebsd-r352586
  head/devel/llvm90/files/lld/
  head/devel/llvm90/files/lld/patch-freebsd-r352600
  head/devel/llvm90/files/patch-freebsd-r352318
  head/devel/llvm90/files/patch-freebsd-r352629
Comment 7 commit-hook freebsd_committer freebsd_triage 2019-10-10 00:45:43 UTC
A commit references this bug:

Author: jbeich
Date: Thu Oct 10 00:44:58 UTC 2019
New revision: 514199
URL: https://svnweb.freebsd.org/changeset/ports/514199

Log:
  gecko: drop LLVM_DEFAULT workaround for i386 after r514194

  PR:		240918

Changes:
  head/Mk/bsd.gecko.mk
  head/www/cliqz/Makefile
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-10-28 21:04:48 UTC
A commit references this bug:

Author: brooks
Date: Mon Oct 28 21:04:18 UTC 2019
New revision: 515935
URL: https://svnweb.freebsd.org/changeset/ports/515935

Log:
  MFH: r513490 r514194 r515213

  Fix build with EXTRAS disabled.

  clangd is part of EXTRAS, not CLANG.

  PR:		240826
  Reported by:	rozhuk.im@gmail.com

  Rollup of fixes since the 9.0.0 release.

  - Change the default -march for i386 from i486 to i586.  This avoids
    the need for libatomics and had been the defacto default for some
    time. [0]

  - Add -m(no)-spe to clang. (powerpc)

  - Deduce MIPS specific ELF header flags from `emulation`. (mips)

  - Fix a variety of assertions and compile/link errors including crashes
    with CPUTYPE=haswell. [1]

  - Switch back to https for downloads. [2]

  The new patches were initially committed to FreeBSD src by dim@.

  PR:		240918 [0], 240759 [1], 240870 [2]
  Reported by:	jbeich [0,1],  Miyashita Touka <imagin8r@protonmail.com> [2]

  Fix build without CLANG enabled. [0]

  Fix LLD build where PREFIX != LOCALBASE. [1]

  powerpc64: add configure option to select ELFv2 ABI [2]

  In preparation for compiler+ABI change in PowerPC64, this change adds a
  configure option to select ELFv2 as default powerpc64 ABI when compiling
  llvm90.

  The new option automatically set when ELFv2 environment is detected
  (when PPC_ABI=ELFv2)

  PR:		241400 [1], 241410 [0]
  Submitted by:	Alfredo Dal'Ava J?nior [2]
  Differential Revision:	https://reviews.freebsd.org/D22100 [2]

  Approved by:	portmgr (blanket for build and reliability fixes)

Changes:
_U  branches/2019Q4/
  branches/2019Q4/devel/llvm90/Makefile
  branches/2019Q4/devel/llvm90/Makefile.COMMANDS
  branches/2019Q4/devel/llvm90/files/clang/patch-freebsd-r352030
  branches/2019Q4/devel/llvm90/files/clang/patch-freebsd-r352539
  branches/2019Q4/devel/llvm90/files/clang/patch-freebsd-r352586
  branches/2019Q4/devel/llvm90/files/lld/
  branches/2019Q4/devel/llvm90/files/patch-freebsd-r352318
  branches/2019Q4/devel/llvm90/files/patch-freebsd-r352629
  branches/2019Q4/devel/llvm90/files/ppc64-elfv2/
  branches/2019Q4/devel/llvm90/pkg-plist
Comment 9 Brooks Davis freebsd_committer freebsd_triage 2019-10-28 21:05:18 UTC
Merged to quarterly.