Bug 233611

Summary: [meta] base system migration from obsolete GNU as 2.17.50
Product: Base System Reporter: Ed Maste <emaste>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: cem, mpysw
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Bug Depends on: 205250    
Bug Blocks: 233094    

Description Ed Maste freebsd_committer freebsd_triage 2018-11-28 15:37:05 UTC
One of the goals for FreeBSD 13.0 is to retire obsolete binutils 2.17.50.  In order to do so we need to address a few assembly files in the tree that are currently assembled by GNU as.  (Most assembly files have a .S extension and are assembled by invoking the compiler driver, which uses Clang's Integrated Assembler (IAS) by default on many architectures.)

Below is a list of .s files (typically assembled by GNU as) in the tree, sorted by architecture.


i386/amd64 (used by both):

stand/i386/kgzldr/crt.s
stand/i386/kgzldr/sio.s
stand/i386/kgzldr/start.s
stand/i386/mbr/mbr.s
stand/i386/pmbr/pmbr.s


amd64:

sys/crypto/skein/amd64/skein_block_asm.s


i386:

cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.badinstr.s
cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.branch.s
cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.embedded.s
cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.ret.s
cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/pid/tst.retlist.s
cddl/contrib/opensolaris/cmd/dtrace/test/tst/i386/ustack/tst.circstack.s
sys/i386/i386/apic_vector.s
sys/i386/i386/atpic_vector.s
sys/i386/i386/bioscall.s
sys/i386/i386/copyout_fast.s
sys/i386/i386/exception.s
sys/i386/i386/locore.s
sys/i386/i386/mpboot.s
sys/i386/i386/sigtramp.s
sys/i386/i386/support.s
sys/i386/i386/swtch.s
sys/i386/i386/vm86bios.s
sys/i386/linux/linux_vdso.lds.s
tools/test/vm86/vm86_test_asm.s


*** sparc64:

cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.br.s
cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.branch.s
cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/pid/tst.embedded.s
cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/ustack/tst.circstack.s
lib/libc/sparc64/gen/assym.s
lib/libc/sparc64/sys/assym.s
stand/sparc64/boot1/_start.s


*** arm:

sys/arm/arm/setstack.s


*** unused / not applicable:

contrib/libpcap/msdos/pkt_rx1.s
sys/amd64/linux/linux_vdso.lds.s
sys/amd64/linux32/linux32_vdso.lds.s
sys/arm64/linux/linux_vdso.lds.s

(lds.s are linker script files, typically named "ldscript.${arch}" elsewhere in the tree.)
Comment 1 Ed Maste freebsd_committer freebsd_triage 2018-11-28 15:45:55 UTC
It turns out Clang IAS accepts -Wa,-defsym,FOO=BAR but not -Wa,--defsym,FOO=BAR -- see LLVM PR 39825 https://llvm.org/pr39825
Comment 2 Ed Maste freebsd_committer freebsd_triage 2018-11-28 15:59:54 UTC
These two reviews address all of the assembly files used by amd64 except for skein_block_asm.s:
https://reviews.freebsd.org/D18344
https://reviews.freebsd.org/D18369
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-12-03 19:17:27 UTC
A commit references this bug:

Author: emaste
Date: Mon Dec  3 19:16:35 UTC 2018
New revision: 341437
URL: https://svnweb.freebsd.org/changeset/base/341437

Log:
  stand/i386: rename .s to .S to use Clang IAS

  As part of the migration away from obsolete binutils we want to retire
  GNU as.  Most assembly files used on amd64 have a .S extension and
  (via rules in share/mk/bsd.suffixes.mk) are assembled with Clang's
  Integrated Assembler (IAS).  Rename files in stand/i386 to .S to use
  the integrated assembler.

  Clang's IAS supports the defsym option (via -Wa,) but only with one
  dash, not two.  As both -defsym and --defsym are accepted by GNU as,
  use the former.

  PR:		233611
  Reviewed by:	tsoome
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D18369

Changes:
  head/stand/i386/kgzldr/Makefile
  head/stand/i386/kgzldr/crt.S
  head/stand/i386/kgzldr/crt.s
  head/stand/i386/kgzldr/sio.S
  head/stand/i386/kgzldr/sio.s
  head/stand/i386/kgzldr/start.S
  head/stand/i386/kgzldr/start.s
  head/stand/i386/mbr/Makefile
  head/stand/i386/mbr/mbr.S
  head/stand/i386/mbr/mbr.s
  head/stand/i386/pmbr/Makefile
  head/stand/i386/pmbr/pmbr.S
  head/stand/i386/pmbr/pmbr.s
Comment 4 Ed Maste freebsd_committer freebsd_triage 2019-08-01 18:14:46 UTC
skein_block_asm.s modified to assemble with LLVM IAS in review D18758

https://reviews.freebsd.org/D18758
Comment 5 commit-hook freebsd_committer freebsd_triage 2019-08-01 19:02:04 UTC
A commit references this bug:

Author: emaste
Date: Thu Aug  1 19:01:28 UTC 2019
New revision: 350518
URL: https://svnweb.freebsd.org/changeset/base/350518

Log:
  as: add deprecation notice to the man page

  In the future FreeBSD will ship without GNU binutils 2.17.50.  Add a
  note advising users who require GNU as to install the binutils port
  or package.

  Note that on armv7, arm64, amd64, i386 we currently ship only two
  binutils tools (as and objdump).  A deprecation notice was added to
  objdump's man page some time ago.

  PR:		233611
  Discussed with:	jhb
  MFC after:	1 week
  Relnotes:	Yes
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/contrib/binutils/gas/doc/as.texinfo
  head/gnu/usr.bin/binutils/as/as.1
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-08-04 20:41:42 UTC
A commit references this bug:

Author: emaste
Date: Sun Aug  4 20:40:48 UTC 2019
New revision: 350574
URL: https://svnweb.freebsd.org/changeset/base/350574

Log:
  MFC r350518: as: add deprecation notice to the man page

  In the future FreeBSD will ship without GNU binutils 2.17.50.  Add a
  note advising users who require GNU as to install the binutils port
  or package.

  Note that on armv7, arm64, amd64, i386 we currently ship only two
  binutils tools (as and objdump).  A deprecation notice was added to
  objdump's man page some time ago.

  PR:		233611
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/12/
  stable/12/contrib/binutils/gas/doc/as.texinfo
  stable/12/gnu/usr.bin/binutils/as/as.1
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-05-29 17:37:10 UTC
A commit references this bug:

Author: emaste
Date: Fri May 29 17:36:55 UTC 2020
New revision: 361628
URL: https://svnweb.freebsd.org/changeset/base/361628

Log:
  Disable BINUTILS by default on i386

  The retirement of obsolete binutils 2.17.50 has been in progress for
  quite some time.  All tools other than GNU as were removed prior to this
  commit, and it was built only on two archs:

  i386, installed as /usr/bin/as
  amd64, installed as /usr/bin/as and as a bootstrap tool

  The i386 exp-run has completed and failures have been addressed in the
  individual ports, so disable it there.

  PR:		233611, 205250 [exp-run]
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/share/mk/src.opts.mk
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-05-30 16:12:15 UTC
A commit references this bug:

Author: emaste
Date: Sat May 30 16:12:01 UTC 2020
New revision: 361648
URL: https://svnweb.freebsd.org/changeset/base/361648

Log:
  Disable BINUTILS by default on amd64

  The retirement of obsolete binutils 2.17.50 has been in progress for
  quite some time.  All tools other than GNU as were removed prior to this
  commit, and it was built only on amd64 - installed as /usr/bin/as, and
  used as a bootstrap tool.

  The amd64 exp-run has completed and failures have now been addressed in
  the individual ports, so disable it by default.

  PR:		233611, 205250 [exp-run]
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/share/mk/src.opts.mk
Comment 9 Ed Maste freebsd_committer freebsd_triage 2020-05-30 16:15:24 UTC
as is now used only on amd64, as a bootstrap tool for skein_block_asm.s.
Comment 10 commit-hook freebsd_committer freebsd_triage 2020-06-06 02:28:08 UTC
A commit references this bug:

Author: emaste
Date: Sat Jun  6 02:27:29 UTC 2020
New revision: 361857
URL: https://svnweb.freebsd.org/changeset/base/361857

Log:
  src.opts.mk: disable BINUTILS_BOOTSTRAP universally

  As of r361853 skein_block_asm.S is assembled using Clang's integrated
  assembler.

  PR:		233611
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/share/mk/src.opts.mk