NetBSD/tools/gcc
riastradh ef315f7931 Remove MKCRYPTO option.
Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export.  The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated.  I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S.  Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet...  That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.
2017-05-21 15:28:36 +00:00
..
Makefile provide a common softfloat fenv implemenation and use it for softfloat builds. 2017-03-22 23:11:07 +00:00
README.mknative Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
gcc-version.mk GC more gcc 4.8 specific (dead) logic 2017-02-22 12:34:49 +00:00
mknative-gcc revert our changes; softfloat removal is now done in libgcc/config.host 2016-10-05 19:25:49 +00:00
mknative-gcc.old set _OUTDIR and _OUTDIRBASE properly for gcc.old, and fix a sed. 2016-04-21 07:22:15 +00:00
mknative.common Merge gcc-4.8 mknative bits. 2014-02-17 21:39:43 +00:00

README.mknative

$NetBSD: README.mknative,v 1.21 2017/05/21 15:28:42 riastradh Exp $

This file describes how to bootstrap the native toolchain on a new NetBSD
platform (and how to update the new toolchain files, if needed).  These
files may be generated on a cross-compile host without problems.

NOTE:  DO NOT RUN "mknative" BY HAND!  It requires the Makefile in this
directory to set up certain environments first.

Since libc's features change over time, the config.h files can change as a
result; thus the instructions below are the same no matter whether
bootstrapping on a cross or native host.  This is important: even on a
"native" host, you should bootstrap the toolchain by building from an
up-to-date source tree to a $DESTDIR using the exact same instructions.

In these notes, MACHINE is the $MACHINE of the target.  These files can be
cross-generated.  Though a $MACHINE_ARCH all uses the same config files, you
must pick a specific $MACHINE so that building the requisite bits below will
work.

0. Note that example paths like src/external/gpl3/gcc/lib/libgcc/arch will
   really be src/external/gpl3/gcc.old/lib/libgcc/arch for the previous GCC.

1. Set MKMAINTAINERTOOLS=yes in mk.conf.  (Needed so that src/tools/gettext
   gets built, eliciting proper HAVE_*GETTEXT* defns in config.h files.)

2. Build and install a cross toolchain (via "build.sh -m MACHINE tools").
   Note that while PR #47353 is not fixed, you can not use the -O option
   to build.sh. Use -M instead. (The differences are in layout and pathname
   prefixes in the object directory pointed to by each option.)

3. In src/tools/gcc, do "nbmake-MACHINE HAVE_GCC=48 bootstrap-libgcc".

   This will create just enough glue in src/external/gpl3/gcc/lib/libgcc/arch
   to make it possible to build, based on the toolchain built in
   ${.OBJDIR}/build.
   Because the files generated in this step contain things like
   -DCROSS_COMPILE, they are not suitable for committing.  Step 8 below
   will regenerate the "proper" libgcc config files.

4. At top level, do
   "nbmake-MACHINE obj do-distrib-dirs MKGCC=no MKBINUTILS=no HAVE_GCC=48", and
   "nbmake-MACHINE includes HAVE_GCC= MKGCC=no MKBINUTILS=no HAVE_GCC=48".
   (Note: replace 48 [for gcc 4.8.x] with the appropriate version you are
   going to mknative-for, the MKGCC=no prevents the standard makefiles from
   picking up any gcc version info automatically)

5. In src/lib/csu, do
   "nbmake-MACHINE dependall". and "nbmake-MACHINE install".

6. In src/external/gpl3/gcc/lib/libgcc, do
   "nbmake-MACHINE obj includes dependall install".

7. In each of src/external/lgpl3/gmp/lib/libgmp,
   src/external/lgpl3/mpfr/lib/libmpfr, src/external/lgpl3/mpc/lib/libmpc
   do "nbmake-MACHINE obj dependall".

8. In src/lib, do
   "nbmake-MACHINE dependall install MKGCC=no HAVE_GCC=48".

   Optionally, all of the following may be set in the environment to reduce
   the amount of code needed to build at this step.  Basically, it must be
   possible for static binaries to build and base system libs to exist so
   that "configure" can do its job for the target--these MK* options omit
   the rest for this stage of the build. 

   MKLINT=no
   MKPROFILE=no
   MKSHARE=no
   MKRUMP=no

9. In src/tools/gcc, do "nbmake-MACHINE native-gcc".

   This will do a full configury in ${.OBJDIR}/.native that is a "Canadian"
   cross toolchain (--build reflects the host platform, but --host and
   --target are the target).  The result is a tree that would build a
   native-to-NetBSD compiler on a cross host, and mknative pulls glue data
   from this.

10. Try out a full build using "nbmake-MACHINE"; the result should include
   a native compiler.

11. If all is well, commit the glue files added to src/gnu/{lib,usr.bin}/*.