History log of /openbsd-current/Makefile.cross
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.111 03-May-2021 drahn

riscv64 is a LP64_ARCH, list it as such.


# 1.110 01-May-2021 visa

Retire OpenBSD/sgi.

OK deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.109 14-Aug-2020 patrick

Update compiler-rt path in cross-build infrastructure.


# 1.108 30-May-2020 drahn

Initial set of changes to build powerpc64 toolchain.

Disable PIC/PIE for powerpc64 for now.


Revision tags: OPENBSD_6_7_BASE
# 1.107 07-Nov-2019 mpi

Simplify by getting rid of the unecessary 'depend' rule.

ok patrick@


# 1.106 18-Oct-2019 visa

Add mips64el to LP64_ARCH.

OK patrick@


# 1.105 14-Oct-2019 patrick

Re-sort the if-sequence which sets COMPILER_VERSION to be the same
as bsd.own.mk, otherwise on transitioning architectures the wrong
compiler is chosen. Also make sure BUILD_CLANG is forced for the
libcompiler_rt directory since cross-compiling with two possible
compilers would create too much headache.


# 1.104 14-Oct-2019 patrick

Fix whitespace issues


# 1.103 14-Oct-2019 patrick

powerpc cross-compilation on 64-bit hosts also appears to be safe.


# 1.102 14-Oct-2019 patrick

Pass LINKER_VERSION to binutils and clang cross-build so that they
know who the system linker is.


Revision tags: OPENBSD_6_6_BASE
# 1.101 22-May-2019 patrick

Fix malformed conditional after socppc removal.

From Krystian Lewandowski


# 1.100 11-May-2019 deraadt

socppc makes an extended visit to the bigbucket.
ok kettenis


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


# 1.110 01-May-2021 visa

Retire OpenBSD/sgi.

OK deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.109 14-Aug-2020 patrick

Update compiler-rt path in cross-build infrastructure.


# 1.108 30-May-2020 drahn

Initial set of changes to build powerpc64 toolchain.

Disable PIC/PIE for powerpc64 for now.


Revision tags: OPENBSD_6_7_BASE
# 1.107 07-Nov-2019 mpi

Simplify by getting rid of the unecessary 'depend' rule.

ok patrick@


# 1.106 18-Oct-2019 visa

Add mips64el to LP64_ARCH.

OK patrick@


# 1.105 14-Oct-2019 patrick

Re-sort the if-sequence which sets COMPILER_VERSION to be the same
as bsd.own.mk, otherwise on transitioning architectures the wrong
compiler is chosen. Also make sure BUILD_CLANG is forced for the
libcompiler_rt directory since cross-compiling with two possible
compilers would create too much headache.


# 1.104 14-Oct-2019 patrick

Fix whitespace issues


# 1.103 14-Oct-2019 patrick

powerpc cross-compilation on 64-bit hosts also appears to be safe.


# 1.102 14-Oct-2019 patrick

Pass LINKER_VERSION to binutils and clang cross-build so that they
know who the system linker is.


Revision tags: OPENBSD_6_6_BASE
# 1.101 22-May-2019 patrick

Fix malformed conditional after socppc removal.

From Krystian Lewandowski


# 1.100 11-May-2019 deraadt

socppc makes an extended visit to the bigbucket.
ok kettenis


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


# 1.109 14-Aug-2020 patrick

Update compiler-rt path in cross-build infrastructure.


# 1.108 30-May-2020 drahn

Initial set of changes to build powerpc64 toolchain.

Disable PIC/PIE for powerpc64 for now.


Revision tags: OPENBSD_6_7_BASE
# 1.107 07-Nov-2019 mpi

Simplify by getting rid of the unecessary 'depend' rule.

ok patrick@


# 1.106 18-Oct-2019 visa

Add mips64el to LP64_ARCH.

OK patrick@


# 1.105 14-Oct-2019 patrick

Re-sort the if-sequence which sets COMPILER_VERSION to be the same
as bsd.own.mk, otherwise on transitioning architectures the wrong
compiler is chosen. Also make sure BUILD_CLANG is forced for the
libcompiler_rt directory since cross-compiling with two possible
compilers would create too much headache.


# 1.104 14-Oct-2019 patrick

Fix whitespace issues


# 1.103 14-Oct-2019 patrick

powerpc cross-compilation on 64-bit hosts also appears to be safe.


# 1.102 14-Oct-2019 patrick

Pass LINKER_VERSION to binutils and clang cross-build so that they
know who the system linker is.


Revision tags: OPENBSD_6_6_BASE
# 1.101 22-May-2019 patrick

Fix malformed conditional after socppc removal.

From Krystian Lewandowski


# 1.100 11-May-2019 deraadt

socppc makes an extended visit to the bigbucket.
ok kettenis


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


# 1.108 30-May-2020 drahn

Initial set of changes to build powerpc64 toolchain.

Disable PIC/PIE for powerpc64 for now.


Revision tags: OPENBSD_6_7_BASE
# 1.107 07-Nov-2019 mpi

Simplify by getting rid of the unecessary 'depend' rule.

ok patrick@


# 1.106 18-Oct-2019 visa

Add mips64el to LP64_ARCH.

OK patrick@


# 1.105 14-Oct-2019 patrick

Re-sort the if-sequence which sets COMPILER_VERSION to be the same
as bsd.own.mk, otherwise on transitioning architectures the wrong
compiler is chosen. Also make sure BUILD_CLANG is forced for the
libcompiler_rt directory since cross-compiling with two possible
compilers would create too much headache.


# 1.104 14-Oct-2019 patrick

Fix whitespace issues


# 1.103 14-Oct-2019 patrick

powerpc cross-compilation on 64-bit hosts also appears to be safe.


# 1.102 14-Oct-2019 patrick

Pass LINKER_VERSION to binutils and clang cross-build so that they
know who the system linker is.


Revision tags: OPENBSD_6_6_BASE
# 1.101 22-May-2019 patrick

Fix malformed conditional after socppc removal.

From Krystian Lewandowski


# 1.100 11-May-2019 deraadt

socppc makes an extended visit to the bigbucket.
ok kettenis


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


# 1.107 07-Nov-2019 mpi

Simplify by getting rid of the unecessary 'depend' rule.

ok patrick@


# 1.106 18-Oct-2019 visa

Add mips64el to LP64_ARCH.

OK patrick@


# 1.105 14-Oct-2019 patrick

Re-sort the if-sequence which sets COMPILER_VERSION to be the same
as bsd.own.mk, otherwise on transitioning architectures the wrong
compiler is chosen. Also make sure BUILD_CLANG is forced for the
libcompiler_rt directory since cross-compiling with two possible
compilers would create too much headache.


# 1.104 14-Oct-2019 patrick

Fix whitespace issues


# 1.103 14-Oct-2019 patrick

powerpc cross-compilation on 64-bit hosts also appears to be safe.


# 1.102 14-Oct-2019 patrick

Pass LINKER_VERSION to binutils and clang cross-build so that they
know who the system linker is.


Revision tags: OPENBSD_6_6_BASE
# 1.101 22-May-2019 patrick

Fix malformed conditional after socppc removal.

From Krystian Lewandowski


# 1.100 11-May-2019 deraadt

socppc makes an extended visit to the bigbucket.
ok kettenis


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


# 1.106 18-Oct-2019 visa

Add mips64el to LP64_ARCH.

OK patrick@


# 1.105 14-Oct-2019 patrick

Re-sort the if-sequence which sets COMPILER_VERSION to be the same
as bsd.own.mk, otherwise on transitioning architectures the wrong
compiler is chosen. Also make sure BUILD_CLANG is forced for the
libcompiler_rt directory since cross-compiling with two possible
compilers would create too much headache.


# 1.104 14-Oct-2019 patrick

Fix whitespace issues


# 1.103 14-Oct-2019 patrick

powerpc cross-compilation on 64-bit hosts also appears to be safe.


# 1.102 14-Oct-2019 patrick

Pass LINKER_VERSION to binutils and clang cross-build so that they
know who the system linker is.


Revision tags: OPENBSD_6_6_BASE
# 1.101 22-May-2019 patrick

Fix malformed conditional after socppc removal.

From Krystian Lewandowski


# 1.100 11-May-2019 deraadt

socppc makes an extended visit to the bigbucket.
ok kettenis


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


# 1.105 14-Oct-2019 patrick

Re-sort the if-sequence which sets COMPILER_VERSION to be the same
as bsd.own.mk, otherwise on transitioning architectures the wrong
compiler is chosen. Also make sure BUILD_CLANG is forced for the
libcompiler_rt directory since cross-compiling with two possible
compilers would create too much headache.


# 1.104 14-Oct-2019 patrick

Fix whitespace issues


# 1.103 14-Oct-2019 patrick

powerpc cross-compilation on 64-bit hosts also appears to be safe.


# 1.102 14-Oct-2019 patrick

Pass LINKER_VERSION to binutils and clang cross-build so that they
know who the system linker is.


Revision tags: OPENBSD_6_6_BASE
# 1.101 22-May-2019 patrick

Fix malformed conditional after socppc removal.

From Krystian Lewandowski


# 1.100 11-May-2019 deraadt

socppc makes an extended visit to the bigbucket.
ok kettenis


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


# 1.101 22-May-2019 patrick

Fix malformed conditional after socppc removal.

From Krystian Lewandowski


# 1.100 11-May-2019 deraadt

socppc makes an extended visit to the bigbucket.
ok kettenis


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


# 1.100 11-May-2019 deraadt

socppc makes an extended visit to the bigbucket.
ok kettenis


Revision tags: OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


# 1.99 04-Feb-2018 patrick

Don't assume that we use LLVM's ld(1) if we use clang(1) as main system
compiler. Only handle this case when LLD was actually installed during
the cross-compiler setup. Unbreaks armv7 after switching to clang since
it uses binutils' ld(1).


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@


Revision tags: OPENBSD_6_2_BASE
# 1.98 23-Sep-2017 patrick

Compile the cross-compiler in the target's objdir instead of polluting
the host's. This also allows compiling multiple toolchains in parallel.
Clean up the clang object files afterwards so it doesn't collide with
the cross-compiled compiler build.


# 1.97 12-Sep-2017 mpi

Fix cross-compiling GCC toolchains on Clang archs.

ok patrick@


# 1.96 11-Aug-2017 drahn

Fix cross builds: no clang depend target, no DESTDIR on HOSTCC build
ok patrick@


# 1.95 08-Jun-2017 patrick

Pass CC and CXX to make depend as well. As soon as we support
dependencies in the clang makefiles we need to make sure to use
a compiler that supports C++11.


# 1.94 23-May-2017 patrick

Adjust cross-toolchain environment to the changes in the clang build
fabric. Since we now also build and use LLVM's lld we can copy lld to
the proper directory akin to what we do with clang. Build compiler-rt
early as it is needed for building libc.

"go for it" mpi@


Revision tags: OPENBSD_6_1_BASE
# 1.93 21-Mar-2017 patrick

Export CROSSDIR so that the two users (ld.so and binutils) of that
variable actually work correctly. While there, adjust a bit for
consistency.

"nobody will complain if you break it ;)" kettenis@


# 1.92 27-Jan-2017 jsg

We can now build parts of binutils on aarch64 so enable cross-binutils
again.

ok patrick@


# 1.91 20-Jan-2017 patrick

Adjust cross-compilation infrastructure to cope with builduser
permission requirements.

From Dale Rahn.

ok tb@
"commit it" guenther@


# 1.90 04-Jan-2017 patrick

With clang as cross-compiler we need to tell it where our cross
directory is so that the correct include and library paths are used.
For this we create a simple wrapper that calls clang in the correct
mode and also passes the sysroot.

ok kettenis@


# 1.89 18-Dec-2016 patrick

Implement support for cross-compiling arm64 in Makefile.cross. This
adds code to build clang as cross-compiler instead of gcc. Since we
don't have binutils for aarch64 in base, skip the binutils cross-
toolchain build for that architecture.

ok kettenis@


# 1.88 23-Sep-2016 sthen

Unhook sqlite3.


# 1.87 03-Sep-2016 guenther

Retire zaurus, as it hasn't made the EABI jump and will be permanently broken
shortly when we use the hardware thread register in userland


# 1.86 10-Aug-2016 deraadt

armish handled some early-gen arm machines, which required tons of
workarounds. Some of them will soon stand in the way of armv7.
Off to the attic you go.


Revision tags: OPENBSD_6_0_BASE
# 1.85 11-May-2016 deraadt

remove hppa64 port, which we never got going beyond broken single users.
hppa reverse-stack gives us a valuable test case, but most developers don't
have a 2nd one to proceed further with this.
ok kettenis


# 1.84 09-Mar-2016 deraadt

We are done providing support for the vax.
lots of agreement.


Revision tags: OPENBSD_5_9_BASE
# 1.83 08-Dec-2015 tobiasu

Restore parenthesis


# 1.82 01-Dec-2015 deraadt

Send solbourne to where the ...........


# 1.81 01-Dec-2015 deraadt

Send Aviion to same place as Nova II
discussed with jsg


# 1.80 14-Nov-2015 deraadt

libocurses can go to the Attic. last consumer of it was ramdisk more(1)
conceptual ok guenther millert nicm


# 1.79 10-Nov-2015 uebayasi

Always honor ${DESTDIR}. OK miod@


Revision tags: OPENBSD_5_8_BASE
# 1.78 05-Jun-2015 tobiasu

Use target BSDOBJDIR when cross-compiling libraries

ok mpi@


# 1.77 01-Jun-2015 miod

Now that we do not need to build binutils 2.15 (except for gdb), simplify the
build logic.


# 1.76 28-May-2015 miod

Invert the binutils 2.17 logic to only list non-2.17 platforms.


Revision tags: OPENBSD_5_7_BASE
# 1.75 08-Feb-2015 uebayasi

Fix cross-build. OK jsing@ miod@ guenther@ deraadt@


# 1.74 09-Oct-2014 lteo

Remove the last gzsig tendril


# 1.73 24-Aug-2014 deraadt

more NO_CROSS


Revision tags: OPENBSD_5_6_BASE
# 1.72 16-Jul-2014 deraadt

lynx will go to ports. there are too many reasons for it to go there,
and not enough for it to stay. lengthy discussions.


# 1.71 09-May-2014 miod

Make sure to override PIE_DEFAULT when building a cross-gcc4


# 1.70 23-Apr-2014 ajacoutot

Remove more Kerberos cruft.

ok jca@ jmc@


# 1.69 18-Mar-2014 miod

Retire hp300, mvme68k and mvme88k ports. These ports have no users, keeping
this hardware alive is becoming increasingly difficult, and I should heed the
message sent by the three disks which have died on me over the last few days.

Noone sane will mourn these ports anyway. So long, and thanks for the fish.


Revision tags: OPENBSD_5_5_BASE
# 1.68 04-Sep-2013 patrick

Beagle has been replaced by armv7.


# 1.67 06-Aug-2013 miod

Remove support for COMPILER_VERSION == gcc2.
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4
is the norm and to explicitely test for gcc3 when a different behaviour
is required.
No functional change intended. Be sure to `make install' in share/mk before
attempting to do anything.


Revision tags: OPENBSD_5_4_BASE
# 1.66 06-Jul-2013 miod

tabs got lost in previous rev


# 1.65 05-Jul-2013 miod

ELF_TOOLCHAIN bye bye.


# 1.64 04-Apr-2013 jasper

remove BIN{MODE,GRP,OWN} since bsd.own.mk is already included.

ok bmercer@


# 1.63 25-Mar-2013 deraadt

gumstix was never finished


# 1.62 25-Mar-2013 deraadt

the unused palm code goes away.


# 1.61 10-Mar-2013 miod

Allow the PIE/NOPIE variables in bsd.own.mk to be overriden. Force proper
values in Makefile.cross to make sure binutils are built with the proper
PIE_DEFAULT value for the target.
ok millert@ deraadt@


Revision tags: OPENBSD_5_3_BASE
# 1.60 02-Feb-2013 miod

m68k ports are now ELF citizens.


# 1.59 05-Jan-2013 miod

Switch m88k ports to ELF.


# 1.58 13-Nov-2012 miod

Pass -DOPENBSD_CROSS to CFLAGS when cross-compiling gcc2. Temporary bandaid
until we get rid of it. Soon.


# 1.57 13-Nov-2012 miod

Make COMPILER_VERSION a definitive assignment in there, for it to override
<bsd.own.mk>. Allows cross-gcc to be built on a host using a different compiler
version than the target.


# 1.56 23-Aug-2012 deraadt

no need to know about afs, since it is gone


# 1.55 14-Aug-2012 matthew

Garbage collect the USE_GCC variables; everything uses
COMPILER_VERSION now.

From Brad.


# 1.54 02-Aug-2012 okan

remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.

ok guenther@


Revision tags: OPENBSD_5_2_BASE
# 1.53 13-Jul-2012 jsing

Add sqlite3 to NO_CROSS since it depends on libreadline - this would then
require cross-gnu to build before we can build cross-bin.


# 1.52 20-Jun-2012 matthew

more mac68k bits for the attic


# 1.51 06-Apr-2012 jsing

Do not try to cross build nginx, since it does not work.


Revision tags: OPENBSD_5_1_BASE
# 1.50 12-Nov-2011 jasper

- add avr32 which'll use gcc4/binutils-2.17
- remove BINUTILS217_ARCH from Makefile.cross as bsd.own.mk is included there
(requested by drahn@)

ok drahn@ deraadt@


# 1.49 11-Nov-2011 drahn

Allow 64bit -> arm cross compilation as it appears safe (amd64 -> arm at least)
include bsd.own.mk to get the correct compiler architectures
(if only Makefile.cross is used)


# 1.48 23-Sep-2011 guenther

Detect word-size mismatches between host and target, which result in
the cross compiler generating bad code, and abort

ok deraadt@


# 1.47 18-Sep-2011 kettenis

ia64 should use gcc4; sort the list of binutils-2.17 platforms while I'm there

ok jsing@, miod@


Revision tags: OPENBSD_5_0_BASE
# 1.46 05-Aug-2011 kettenis

Switch hppa64 cross compiling environment to gcc4.


# 1.45 27-Jul-2011 kettenis

Switch hppa64 to binutils-2.17


# 1.44 07-Jul-2011 deraadt

remove mvmeppc; it is really rough shape. ok drahn miod


# 1.43 05-Jul-2011 drahn

Allow switching between binutils and binutils 2.17.
NOTE: binutils-2.17 has not been tested on any archs. ok pirofti@


# 1.42 16-Jun-2011 mpi

Typo, BINOWN -> BINGRP

ok miod@


Revision tags: OPENBSD_4_9_BASE
# 1.41 17-Oct-2010 djm

unlink libsectok from the build; ok markus@ deraadt@


# 1.40 25-Sep-2010 drahn

Copy the right bits to the right places for gcc4.


# 1.39 24-Sep-2010 miod

Switch mips-based ports to gcc4. Most of the work has been done by kettenis@.


# 1.38 23-Sep-2010 pirofti

Remove tn3270 reference.


# 1.37 20-Sep-2010 syuu

add octeon as cross build target arch. ok miod@


# 1.36 20-Sep-2010 drahn

nsd uses configure, so put it in NO_CROSS for now.


# 1.35 09-Sep-2010 drahn

Sigh, check in the actual diff, not a backout of th previous change.
Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.34 09-Sep-2010 drahn

Use TARGET_ARCH, not MACHINE_ARCH. Fix from Tobias Ulmer. ok jsg@ jasper@


# 1.33 25-Aug-2010 jsg

sync the list of gcc4 archs with bsd.own.mk
ok miod@


Revision tags: OPENBSD_4_8_BASE
# 1.32 09-Jul-2010 drahn

Fix cross build problem with cpp, marex pointed out that it wasn't committed.


# 1.31 01-Jun-2010 drahn

Initial attempt at being COMPILER_VERSION and gcc4 compatible.


# 1.30 31-May-2010 drahn

moko goes away.


Revision tags: OPENBSD_4_7_BASE
# 1.29 05-Feb-2010 miod

Force MACHINE_CPU when building cross-toolchain or cross-building. This allows
loongson cross-tools to be configured correctly.


# 1.28 21-Sep-2009 matthieu

Add all arm based architectures. ok miod@.


# 1.27 09-Sep-2009 marex

Palm: Integration into the tree

OK deraadt@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.26 06-Sep-2008 drahn

Try to clean up the cross build environment, more of the tree cross builds now
ok miod@


Revision tags: OPENBSD_4_4_BASE
# 1.25 13-May-2008 miod

socppc is powerpc


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.24 01-Aug-2007 deraadt

another cats remnant


Revision tags: OPENBSD_4_1_BASE
# 1.23 06-Feb-2007 mickey

feed bsdsrc/objdir and makeobjdir in cross-env allowing make obj and the like to work on random directories; found w/ rainerx0r; drahn@ ok


# 1.22 19-Dec-2006 deraadt

missing TARGET_ARCH handling (solbourne)


# 1.21 06-Oct-2006 miod

Early bits for a 32-bit SuperH toolchain, currently for little-endian
systems only; more work is necessary in ld land.


# 1.20 27-Sep-2006 mickey

alpha is gcc3 now


Revision tags: OPENBSD_4_0_BASE
# 1.19 16-Jun-2006 mickey

typoo


# 1.18 06-Jun-2006 drahn

System build pieces for armish arch.


# 1.17 09-May-2006 miod

Administrative changes for aviion, ok deraadt@


# 1.16 04-May-2006 miod

Install binutils objdump on a.out cross-tools; ok grange@


# 1.15 19-Apr-2006 miod

make sure cross-as and cross-ranlib get compiled again for a.out platforms.


# 1.14 19-Apr-2006 mickey

photurisd is nomore; from Michael Knudsen


Revision tags: OPENBSD_3_9_BASE
# 1.13 30-Dec-2005 grange

Disable lint for libraries.

ok deraadt@ espie@


# 1.12 18-Sep-2005 drahn

Fix cross-etc-root-var, pick up target etc files, simplied fix from PR4511
ok grange@


# 1.11 11-Sep-2005 miod

Compute TARGET_ARCH in the Makefile, rather than in a shell, and use it
instead of MACHINE_ARCH to pick compiler and binutils versions.

looked at mickey@ grange@


# 1.10 11-Sep-2005 miod

Create proper symlink for a.out as.


# 1.9 11-Sep-2005 miod

Create a correct /usr/bin/cpp for a.out platforms.


Revision tags: OPENBSD_3_8_BASE
# 1.8 28-Jun-2005 martin

telnetd is gone


Revision tags: OPENBSD_3_7_BASE
# 1.7 12-Mar-2005 grange

Kill \n at EOF.


# 1.6 28-Jan-2005 mickey

match gcc3 logic from bsd.own.mk and add a target_arch generation for arm


# 1.5 20-Jan-2005 grange

No need for cross nm/size in cross-env, our host tools are good enough.

ok mickey@


# 1.4 19-Jan-2005 grange

Unbreak cross-tools by providing TARGET_ARCH in include target
to get right config.status file for binutils and gcc.

ok mickey@


# 1.3 12-Jan-2005 espie

less confusing `TARGET_USE_GCC3' since it's only used locally.
Okay niklas@


# 1.2 10-Jan-2005 espie

- introduce TARGET_CANON/TARGET_ARCH shell variables, to make things slightly
clearer.

- don't put full path into symlinks that don't change directory.

- add a few NO_CROSS directories: stuff that depends on libcrypto, stuff
that needs host tools, and stuff that wants cross-configure.

okay niklas@


# 1.1 09-Jan-2005 espie

move cross-stuff into its own file.
okay mickey@, niklas@