Commit Graph

715 Commits

Author SHA1 Message Date
Ed Maste
90b9aa475e Remove now-unused GNU as build infrastructure 2020-06-07 13:53:23 +00:00
Ed Maste
74e8d41e0a Retire BINUTILS and BINUTILS_BOOTSTRAP options
As of r361857 all BINUTILS options are disabled by default - ports
have been changed to depend on binutils if they require GNU as, and
all base system assembly files have been switched to use Clang's
integrated assembler.

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2020-06-07 00:07:21 +00:00
Ed Maste
0ad202f312 Remove GNU objcopy and objdump build infrastructure
We haven't used the GNU versions of these tools for some time.
2020-06-06 02:45:57 +00:00
Ed Maste
af097a7d50 binutils: build as with BINUTILS || BINUTILS_BOOTSTRAP
Previously we descended into as only if MK_BINUTILS was true, including
during the bootstrap tool phase.  BINUTILS is now disabled by default on
all archs, and we failed to build it during amd64 bootstrap.

Descend into as if either BINUTILS or BINUTILS_BOOTSTRAP is enabled.

This is not quite correct: we should either have the test also depend on
BOOTSTRAPPING, or set BINUTILS to the value of BINUTILS_BOOTSTRAP during
the bootstrap phase.  However, this simple change fixes the build and
has been tested, and binutils will be removed completely in the near
future.
2020-05-30 19:16:33 +00:00
Ed Maste
80b7615484 binutils: disconnect objdump from the build
The in-tree binutils is old and will not be updated.  It does not support
all archs supported by FreeBSD, and for the archs it does support not all
CPU features are supported.

Other tools have migrated to copyfree alternatives.  Although llvm-objdump
is nearly a drop-in replacement for GNU objdump it is missing a few options
and has some differences in output format.  For now just remove GNU objdump;
ports and developers can use a contemporary, maintained version from ports
or packages.  We can revisit installing llvm-objdump as objdump in the
future.

PR:		212319 [exp-run]
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7338
2020-05-06 18:38:40 +00:00
Ed Maste
93e59da238 remove binutils ld leftovers 2020-03-27 19:17:45 +00:00
Brandon Bergren
ded22b4527 Now that there are no remaining users of ld.bfd, remove the ld subdir. 2020-03-27 01:12:11 +00:00
Brandon Bergren
a04ec978b3 [PowerPC] Switch powerpc and powerpcspe to lld
Now that LLD 10 is out, and required patches have landed, we are now ready
to finally switch away from the ancient in-tree ld.bfd.

Special thanks to Fangrui Song for many hours of work on getting the
32-bit powerpc lld ready for prime-time.

Reviewed by:	emaste (earlier revision), jhibbits
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D24111
2020-03-27 01:00:03 +00:00
Ed Maste
7793be9752 limit building GNU assembler (as) to x86
GNU as 2.17.50 is currently required by amd64 and i386 for at least one
file that cannot be assembled by Clang's integrated assembler (IAS).
Other supported CPU architectures either use Clang IAS for all assembly
files, or rely on external toolchain.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23180
2020-01-19 19:16:32 +00:00
Ed Maste
1e1c6bb49f limit ld.bfd to powerpc
All archs except powerpc either use lld or require external toolchain.
powerpc still needs binutils ld to link 32-bit binaries.

Reviewed by:	jhibbits
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23107
2020-01-14 17:56:54 +00:00
Ed Maste
7959685201 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
2019-08-01 19:01:27 +00:00
Ed Maste
840dff46ae objdump: be explicit that GNU objdump that will be removed
We may install llvm-objdump as objdump (see review D18307) or just
provide no /usr/bin/objdump, but either way GNU objdump won't be
installed in the future.

MFC after:	3 days
2019-08-01 14:42:41 +00:00
Ed Maste
8e28ac6b96 objdump: move deprecation notice to indended spot in the man page
r335217 added a deprecation notice to the source file for the objdump
man page, and r335219 added it to the rendered objdump.1, but in the
wrong spot.

MFC after:	3 days
2019-08-01 14:39:26 +00:00
Leandro Lupori
8fcd12f526 [PPC] Enable build/install of ld.bfd on base
When using LLVM+clang+lld on PowerPC64, ld.bfd is also needed,
to link 32-bit binaries correctly, as lld support for 32-bit is
still minimal.

This change enables it to be built and installed when lld is used.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D20259
2019-05-20 16:00:32 +00:00
Ed Maste
07c9bf2a44 Apply WITH_PIE changes to other binutils components
Followon to r345489, explicitly specified bare .a libraries need
${PIE_SUFFIX} (although these still built).

MFC with:	r345489
2019-03-25 01:18:26 +00:00
Ed Maste
bce37ebc34 Fix GNU objdump build under WITH_PIE
Explicitly specified bare .a libraries need ${PIE_SUFFIX}.

Reported by:	David E. Cross, on twitter
2019-03-25 01:06:29 +00:00
John Baldwin
e91609a771 Divorce MK_GDB from MK_BINUTILS.
This permits legacy GDB to still be built and installed if
WITHOUT_BINUTILS is set (e.g. if base/binutils is installed).

Reviewed by:	emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D19480
2019-03-06 20:13:02 +00:00
Alex Richardson
985b8e2b12 Avoid bsd.files.mk duplicate rule warning for bfd ldscripts
Without this change I get lots of
warning: duplicate script for target "_FILESINS_ldscripts/elf64btsmip_fbsd.xw" ignored
message for every tree walk.

Reviewed By:	imp, emaste
Differential Revision: https://reviews.freebsd.org/D18783
2019-01-09 11:13:05 +00:00
Ed Maste
eda7d3bec4 Do not install GNU ld if lld is /usr/bin/ld
GNU binutils ld.bfd 2.17.50 does not support ifuncs and produces broken
binaries when ifuncs are in use.  When LLD_IS_LD is default we have an
ifunc-capable system linker and can just avoid installing ld.bfd.

Reported by:	theraven
Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18340
2018-11-26 17:07:35 +00:00
Brooks Davis
397358d9ac Disable sbrk() use in GNU tools.
We're studing the possibility of deprecating sbrk().  To make it easier
we're removing unnecessicary uses in the base system.  None of these
tools require sbrk(), but they agressively prefer it for no good reason.

Reviewed by:    andrew
Approved by:	re (kib)
Sponsored by:	DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D16141
2018-09-21 17:44:05 +00:00
Andrew Turner
ae1dac06a2 Teach binutils that arm64 is a 64bit architecture. This is needed to cross
build from arm64 to other architectures that use binutils.

Sponsored by:	ABT Systems Ltd
2018-07-06 11:50:59 +00:00
Bryan Drewery
d74021d65b Rework how the ld link is handled in WORLDTMP from r322811.
LLD_BOOTSTRAP (build) is independent of LLD_IS_LD (installed) so they
should not be based on each other.

This is related to upcoming WITH_SYSTEM_LINKER work.

Reviewed by:	emaste
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D15836
2018-06-20 16:10:02 +00:00
Ed Maste
2f9cfbc6f3 objdump.1: manually apply r229046 to the rendered man page 2018-06-15 17:16:27 +00:00
Ed Maste
337981bd89 When lld is ld, install bfd's man page as ld.bfd.1
When WITH_LLD_IS_LD is set, lld's man page is installed as ld.1.gz, as
was GNU BFD's man page prior to this change.

Reported by:	Tobias Kortkamp
Sponsored by:	The FreeBSD Foundation
2018-03-04 01:37:49 +00:00
Bryan Drewery
635718c0d9 Rename RELTOP since it will mean something else globally.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:37 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Warner Losh
0b972ac92e Support armv7 builds for userland
Make armv7 as a new MACHINE_ARCH.

Copy all the places we do armv6 and add armv7 as basically an
alias. clang appears to generate code for armv7 by default. armv7 hard
float isn't supported by the the in-tree gcc, so it hasn't been
updated to have a new default.

Support armv7 as a new valid MACHINE_ARCH (and by extension
TARGET_ARCH).

Add armv7 to the universe build.

Differential Revision: https://reviews.freebsd.org/D12010
2017-10-05 23:01:33 +00:00
Jonathan Anderson
bab31140a2 Remove redundant source and object files.
Reviewed by:	bdrewery, ngie
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D12208
2017-09-09 13:18:32 +00:00
Warner Losh
40b0fb72f5 Convert all the arm big endian tests into a regexp rather than a list.
Suggested by: emaste@
2017-08-14 22:25:20 +00:00
Warner Losh
7709b2ae16 Make _TO_CPUARCH macro for ARCH to CPUARCH conversions
Consolidate all the regular expressions to convert from MACHINE_ARCH
to MACHINE_CPUARCH into a variable and use that variable in preference
to the almost identical copies in the tree (which should have been
identical).

Differential Revision: https://reviews.freebsd.org/D11986
2017-08-12 17:07:27 +00:00
Ed Maste
f52e4bdfd7 Rename LLD_AS_LD to LLD_IS_LD, for consistency with CLANG_IS_CC
Reported by:	Dan McGregor <dan.mcgregor usask.ca>
2017-01-27 01:59:12 +00:00
John Baldwin
69b4d461be Enable /usr/lib32 for o32 binaries on mips64.
Build and install an o32 set of libraries on mips64 suitable for
running o32 binaries via COMPAT_FREEBSD32. Enable COMPAT_FREEBSD32 in
MALTA64.

Reviewed by:	jmallett, imp
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D9032
2017-01-06 23:30:54 +00:00
Ed Maste
0aa5466e7d Add WITH_LLD_AS_LD build knob
If set it installs LLD as /usr/bin/ld.  LLD (as of version 3.9) is not
capable of linking the world and kernel, but can self-host and link many
substantial applications. GNU ld continues to be used for the world and
kernel build, regardless of how this knob is set.

It is on by default for arm64, and off for all other CPU architectures.

Sponsored by:	The FreeBSD Foundation
2016-11-25 13:15:28 +00:00
Ruslan Bukin
5bca221511 Add full softfloat and hardfloat support for MIPS.
This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8376
2016-10-31 15:33:58 +00:00
Justin Hibbits
dc9b124d66 Create a new MACHINE_ARCH for Freescale PowerPC e500v2
Summary:
The Freescale e500v2 PowerPC core does not use a standard FPU.
Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor
unit, which doubles as a FPU.  The PowerPC SPE ABI is incompatible with the
stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this.
Additionaly, the SPE opcodes overlap with Altivec, so these are mutually
exclusive.  Taking advantage of this fact, a new file, powerpc/booke/spe.c, was
created with the same function set as in powerpc/powerpc/altivec.c, so it
becomes effectively a drop-in replacement.  setjmp/longjmp were modified to save
the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by
the SPE).

Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not
support double-precision floating point.

Also, without a new MACHINE_ARCH it would be impossible to provide binary
packages which utilize the SPE.

Additionally, no work has been done to support ports, work is needed for this.
This also means no newer gcc can yet be used.  However, gcc's powerpc support
has been refactored which would make adding a powerpcspe-freebsd target very
easy.

Test Plan:
This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222
(P1022-based) board, compiled against the new ABI.  Base system utilities
(/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot
multiuser.

Reviewed By:	bdrewery, imp
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D5683
2016-10-22 01:57:15 +00:00
Ed Maste
9ce3c6b09a Retire WITHOUT_ELFCOPY_AS_OBJCOPY option
In FreeBSD 11 ELF Tool Chain's elfcopy is installed as objcopy by
default, with the option to switch back to GNU objcopy by setting
WITHOUT_ELFCOPY_AS_OBJCOPY in make.conf.

We plan to remove the outdated in-tree binutils in FreeBSD 12, so
remove the temporary transition aid.

Reviewed by:	brooks, imp
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7337
2016-10-03 17:49:26 +00:00
Bryan Drewery
b987685fe0 Revert r302670 and r302671 for now.
MACHINE_CPUARCH smells like MACHINE except for arm64/aarch64 which
has it backwards.
2016-07-13 01:35:53 +00:00
Bryan Drewery
8a6bdc134d Create one list of replacements for MACHINE_CPUARCH as MACHINE_CPUARCH_SUB.
This also adds missing s/aarch64/arm64 to the sys.mk version and also
adds back armv6hf for universe since it was added to the sys.mk version
in r300438.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D7159
2016-07-12 18:57:25 +00:00
Warner Losh
2c0e9e2a09 Make armv6 hard float abi by default. Kill armv6hf.
Allow CPUTYPE=soft to build the current soft-float abi libraries.
Add UPDATING entry to announce this.

Approved by: re@ (gjb)
2016-05-18 06:01:18 +00:00
Glen Barber
52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Bryan Drewery
bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Glen Barber
0c9da521fa MFH
Sponsored by:	The FreeBSD Foundation
2016-01-07 17:23:43 +00:00
Ed Maste
dbecd1bfdf Switch GNU ld to be installed as ld.bfd and linked as ld
We intend to replace GNU ld with LLVM's lld, and on the path to there
we'll experiment with having lld installed or linked as /usr/bin/ld.
Thus, make ld.bfd the primary install target for GNU ld, to later
facilitate making the ld link optional.

Reviewed by:	davide, dim
Differential Revision:	https://reviews.freebsd.org/D4790
2016-01-07 00:15:02 +00:00
Glen Barber
b626f5a73a MFH r289384-r293170
Sponsored by:	The FreeBSD Foundation
2016-01-04 19:19:48 +00:00
Ed Maste
e7beaf9968 Install ld also as ld.bfd, for use with cc -fuse-ld=bfd
PR:		205409 [exp-run]
MFC after:	1 week
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2015-12-23 14:31:26 +00:00
Bryan Drewery
b791fbe630 META MODE: Don't create .meta files when symlinking sources into the obj directory.
Tracking these leads to situations where meta mode will consider the
file to be out of date if /bin/sh or /bin/ln are newer than the source
file.  There's no reason for meta mode to do this as make is already
handling the rebuild dependency fine.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:43 +00:00
Bryan Drewery
8b2b71b415 Fix ld not respecting --sysroot.
ld(1) uses the /usr/libdata/ldscripts when linking. These scripts add in the
default search paths of /lib and /usr/lib via 'SEARCH_DIR("DIR")'. These
need to be prefixed by '=' so that the --sysroot flag is respected. This
is not a problem with buildworld since the TOOLS_PREFIX is baked into the
cross-ld. However it is a problem when trying to use ld(1) with --sysroot
anywhere else as it ends up still reading /lib and /usr/lib despite --sysroot.

The default --sysroot (TARGET_SYSTEM_ROOT) is '/' for /usr/bin/ld.

I found this while building with META MODE with uses only --sysroot with
/usr/bin/ld, and found that libraries that I had not built in its sysroot
directory were leaking in. This didn't happen with ports binutils either.  This
would also impact external compiler support.

Reviewed by:	bapt, brooks
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4262
2015-11-24 00:49:29 +00:00
Bryan Drewery
0cc887023b Avoid warning race with creating 'ldscripts' directory during build.
In r204548 the 'rm -f ldscripts' was added likely due to reading the
conditional as 'else it is a file'.  That seems unlikely though and
the more likely case is just that the directory hasn't been created yet.

Because this races with ,ssother scripts, use 'mkdir -p' which is a minimal
modification vs upstream to avoid the warning of 'File exists' if another
script creates it first.  This could replace the 'test -d' as well but
then it's more unneeded change to the upstream script.

Sponsored by:	EMC / Isilon Storage Division
2015-10-16 05:54:41 +00:00
Baptiste Daroussin
9be27fdc00 Merge from head 2015-10-09 22:45:54 +00:00
Simon J. Gerraty
bd47c7ec11 Updated depends 2015-10-07 00:43:05 +00:00