Bug 205250 - [exp-run] removal of /usr/bin/as (evaluate ports impact)
Summary: [exp-run] removal of /usr/bin/as (evaluate ports impact)
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords: needs-qa, patch
Depends on: 233611 233740
Blocks: 233094
  Show dependency treegraph
 
Reported: 2015-12-11 19:51 UTC by Ed Maste
Modified: 2018-12-03 10:00 UTC (History)
2 users (show)

See Also:
koobs: exp-run?


Attachments
patch to remove /usr/bin/as (2.42 KB, patch)
2015-12-11 19:51 UTC, Ed Maste
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2015-12-11 19:51:49 UTC
Created attachment 164125 [details]
patch to remove /usr/bin/as

For those architectures where Clang is the system compiler, the Clang driver it is used to assemble .S files in the base system.

I would like to request an exp-run to determine the impact of not installing /usr/bin/as.
Comment 1 Antoine Brodin freebsd_committer 2015-12-12 12:12:36 UTC
Buildworld doesn't complete on i386 without /usr/bin/as  (problem with i386 assembly in libcrypto?)
Comment 2 Antoine Brodin freebsd_committer 2015-12-13 20:38:58 UTC
Exp-run results on amd64:

http://package18.nyi.freebsd.org/jail.html?mastername=headamd64PR205250-default

11 new failures, and around 200 new ports skipped:

+ {"origin"=>"emulators/qemu-devel", "pkgname"=>"qemu-devel-2.4.0", "phase"=>"build", "errortype"=>"process_failed"}
+ {"origin"=>"emulators/qemu-sbruno", "pkgname"=>"qemu-sbruno-2.4.50.g20151206", "phase"=>"build", "errortype"=>"process_failed"}
+ {"origin"=>"emulators/vmw", "pkgname"=>"vmw-060510_1", "phase"=>"build", "errortype"=>"???"}
+ {"origin"=>"lang/ccl", "pkgname"=>"ccl-1.11", "phase"=>"build", "errortype"=>"???"}
+ {"origin"=>"lang/fpc", "pkgname"=>"fpc-3.0.0", "phase"=>"build", "errortype"=>"process_failed"}
+ {"origin"=>"lang/mit-scheme", "pkgname"=>"mit-scheme-9.2_1", "phase"=>"build", "errortype"=>"process_failed"}
+ {"origin"=>"lang/ocaml", "pkgname"=>"ocaml-4.02.1", "phase"=>"build", "errortype"=>"missing_header"}
+ {"origin"=>"lang/ocaml-nox11", "pkgname"=>"ocaml-nox11-4.02.1", "phase"=>"build", "errortype"=>"missing_header"}
+ {"origin"=>"lang/smlnj", "pkgname"=>"smlnj-110.77", "phase"=>"build", "errortype"=>"install_error"}
+ {"origin"=>"lang/ypsilon", "pkgname"=>"ypsilon-0.9.6.3_3", "phase"=>"build", "errortype"=>"process_failed"}
+ {"origin"=>"multimedia/libxine", "pkgname"=>"libxine-1.2.6_3", "phase"=>"configure", "errortype"=>"configure_error"}

Failure logs:

http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/qemu-devel-2.4.0.log 
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/qemu-sbruno-2.4.50.g20151206.log 
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/vmw-060510_1.log 
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/ccl-1.11.log 
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/fpc-3.0.0.log   
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/mit-scheme-9.2_1.log 
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/ocaml-4.02.1.log  
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/ocaml-nox11-4.02.1.log 
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/smlnj-110.77.log 
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/ypsilon-0.9.6.3_3.log 
http://package18.nyi.freebsd.org/data/headamd64PR205250-default/2015-12-13_17h30m47s/logs/errors/libxine-1.2.6_3.log
Comment 3 Ed Maste freebsd_committer 2015-12-14 16:11:53 UTC
Thanks for the exp-run Antoine.

The mk/* infrastructure uses the Clang driver for assembling .S (uppercase) files and ${AS} for .s (lowercase) files. amd64 world has only .S files, but as you discovered i386 has .s files in secure/lib/libcrypto/i386/
Comment 4 Ed Maste freebsd_committer 2018-02-01 14:54:00 UTC
My earlier comment missed any .s files in the kernel, but amd64 has also grown a single .s file since this was originally submitted:

% git ls-files | grep 'amd64.*\.s$'
sys/amd64/linux/linux_locore.s
sys/amd64/linux/linux_support.s
sys/amd64/linux/linux_vdso.lds.s
sys/amd64/linux32/linux32_locore.s
sys/amd64/linux32/linux32_support.s
sys/amd64/linux32/linux32_vdso.lds.s
sys/crypto/skein/amd64/skein_block_asm.s

The first issue encountered while assembling skein_block_asm.s with Clang is tracked in https://bugs.llvm.org/show_bug.cgi?id=33404; I haven't looked into the next ones after that's addressed.
Comment 5 Mark Millard 2018-08-26 21:36:11 UTC
(In reply to Ed Maste from comment #4)

In my trying to update to -r338319 for amd64 I discovered
that it involves i386's libstand and that in turn also is
using -no-integrated-as . This made my buildworld buildkernel
that used WITHOUT_BINUTILS_BOOTSTRAP= and WITHOUT_BINUTILS=
fail with:

--- btx.o ---
cc: error: unable to execute command: Executable "as" doesn't exist!
cc: error: assembler command failed with exit code 1 (use -v to see invocation)


For reference: examples of -no-integrated-as
(and CLANG_NO_IAS/CLANG_NO_IAS34) . . .

# grep -r "\-no-integrated-as" /usr/src/ | grep -v "/\.svn/" | more
. . . (Ignoring llvm internals here) . . .
/usr/src/sys/conf/kern.mk:CLANG_NO_IAS= -no-integrated-as
/usr/src/sys/conf/kern.mk:CLANG_NO_IAS34= -no-integrated-as

# grep -r "CLANG_NO_IAS" /usr/src/ | grep -v "/\.svn/" | more
/usr/src/lib/libz/Makefile:#ACFLAGS.gvmat64.S=  ${CLANG_NO_IAS}
/usr/src/share/mk/bsd.sys.mk:# only enable it for some files with CLFAGS.$FILE+=${CLANG_NO_IAS}.
/usr/src/share/mk/bsd.sys.mk:CLANG_NO_IAS=       -no-integrated-as
/usr/src/stand/i386/boot2/Makefile:CFLAGS.boot1.S=              ${CLANG_NO_IAS}
/usr/src/stand/i386/btx/btx/Makefile:CFLAGS.btx.S=              ${CLANG_NO_IAS}
/usr/src/stand/i386/btx/btxldr/Makefile:CFLAGS.btxldr.S=        ${CLANG_NO_IAS}
/usr/src/stand/i386/cdboot/Makefile:CFLAGS.cdboot.S=    ${CLANG_NO_IAS}
/usr/src/stand/i386/gptboot/Makefile:CFLAGS.gptldr.S=   ${CLANG_NO_IAS}
/usr/src/stand/i386/gptzfsboot/Makefile:CFLAGS.gptldr.S=        ${CLANG_NO_IAS}
/usr/src/stand/i386/libi386/Makefile:CFLAGS.amd64_tramp.S=      ${CLANG_NO_IAS}
/usr/src/stand/i386/libi386/Makefile:CFLAGS.multiboot_tramp.S=  ${CLANG_NO_IAS}
/usr/src/stand/i386/pxeldr/Makefile:CFLAGS.pxeldr.S=    ${CLANG_NO_IAS}
/usr/src/stand/i386/zfsboot/Makefile:CFLAGS.zfsldr.S=   ${CLANG_NO_IAS}
/usr/src/sys/conf/Makefile.amd64:ASM_CFLAGS.acpi_wakecode.S=    ${CLANG_NO_IAS34}
/usr/src/sys/conf/Makefile.amd64:ASM_CFLAGS.mpboot.S=           ${CLANG_NO_IAS34}
/usr/src/sys/conf/Makefile.i386:ASM_CFLAGS.acpi_wakecode.S=     ${CLANG_NO_IAS34}
/usr/src/sys/conf/Makefile.i386:ASM_CFLAGS.mpboot.s=            ${CLANG_NO_IAS34}
/usr/src/sys/conf/kern.mk:CLANG_NO_IAS= -no-integrated-as
/usr/src/sys/conf/kern.mk:CLANG_NO_IAS34= -no-integrated-as
/usr/src/sys/modules/bios/smapi/Makefile:CFLAGS.smapi_bios.S=   ${CLANG_NO_IAS34}
Comment 6 commit-hook freebsd_committer 2018-11-20 16:55:17 UTC
A commit references this bug:

Author: emaste
Date: Tue Nov 20 16:54:43 UTC 2018
New revision: 340681
URL: https://svnweb.freebsd.org/changeset/base/340681

Log:
  stand: remove CLANG_NO_IAS from btx and gptboot

  Many components under stand/ had CLANG_NO_IAS added when Clang's
  Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
  gained support quite some time ago, and we can now build stand/ with
  IAS.

  Note that in some cases there are small differences in the generated
  output, so CLANG_NO_IAS should be removed only after testing (or after
  finding no differences in the output).

  PR:		205250, 233094
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/stand/i386/btx/btx/Makefile
  head/stand/i386/btx/btxldr/Makefile
  head/stand/i386/gptboot/Makefile
Comment 7 commit-hook freebsd_committer 2018-11-26 19:14:53 UTC
A commit references this bug:

Author: emaste
Date: Mon Nov 26 19:14:34 UTC 2018
New revision: 340990
URL: https://svnweb.freebsd.org/changeset/base/340990

Log:
  btx: rename .s files 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 are
  assembled with Clang's integrated assembler; rename two files in
  stand/i386/btx/lib to .S to use IAS as well.

  The generated .text is identical (the entire .o files are not, as Clang
  adds debug info).

  PR:		205250, 233094
  Discussed with:	imp
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/stand/i386/btx/lib/Makefile
  head/stand/i386/btx/lib/btxsys.S
  head/stand/i386/btx/lib/btxsys.s
  head/stand/i386/btx/lib/btxv86.S
  head/stand/i386/btx/lib/btxv86.s
Comment 8 commit-hook freebsd_committer 2018-11-26 19:30:10 UTC
A commit references this bug:

Author: emaste
Date: Mon Nov 26 19:29:18 UTC 2018
New revision: 340991
URL: https://svnweb.freebsd.org/changeset/base/340991

Log:
  stand/i386/libi386: rename .s file 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 are
  assembled with Clang's Integrated Assembler (IAS); rename pxetram.s to
  .S to use IAS as well.

  The generated .text is identical (the entire .o file is not, as Clang
  adds debug info.)

  PR:		205250, 233094
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/stand/i386/libi386/Makefile
  head/stand/i386/libi386/pxetramp.S
  head/stand/i386/libi386/pxetramp.s