version 1.8, 2017/12/30 02:01:59
|
version 1.9, 2017/12/31 17:15:37
|
Line 18 build gcc versions (typically newer vers
|
Line 18 build gcc versions (typically newer vers
|
in a compiler within ${PREFIX}, e.g. /usr/pkg/gcc6/bin/gcc. This |
in a compiler within ${PREFIX}, e.g. /usr/pkg/gcc6/bin/gcc. This |
compiler can then be used to compile other packages. |
compiler can then be used to compile other packages. |
|
|
The Issue with using base system gcc is typically that it is too old, |
The issue with using base system gcc is typically that it is too old, |
such as gcc 4.5 with NetBSD 6, which cannot compile c++11. Another |
such as gcc 4.5 with NetBSD 6, which cannot compile c++11. Another |
example is gcc 4.8 with NetBSD 7. While this can compile most c++11 |
example is gcc 4.8 with NetBSD 7. While this can compile most c++11 |
programs, it cannot be used for firefox or glibmm (and therefore any |
programs, it cannot be used for firefox or glibmm (and therefore any |
Line 26 package that links against glibmm).
|
Line 26 package that links against glibmm).
|
|
|
Issues when using pkgsrc gcc are that |
Issues when using pkgsrc gcc are that |
|
|
|
- on some platforms, pkgsrc gcc does not build and work |
- it must be bootstrapped, requiring compiling a number of packages |
- it must be bootstrapped, requiring compiling a number of packages |
with the system compiler |
with the system compiler |
- C++ packages that are linked together should be built with the |
- C++ packages that are linked together should be built with the |
Line 65 This section attempts to gather all the
|
Line 66 This section attempts to gather all the
|
clang, when set to use GCC, at least as well as the current |
clang, when set to use GCC, at least as well as the current |
scheme. It is desirable for this logic to work on NetBSD 5. |
scheme. It is desirable for this logic to work on NetBSD 5. |
|
|
|
- All systems should work at least as well as they do before |
|
implementation of new compiler selection logic. |
|
|
- The compiler selection logic should be understandable and not brittle. |
- The compiler selection logic should be understandable and not brittle. |
|
|
## Design |
## Design |
Line 84 sound while mimimizing complexity.
|
Line 88 sound while mimimizing complexity.
|
4.9. |
4.9. |
|
|
- A user-settable variable PKGSRC_GCC_VERSION will declare the |
- A user-settable variable PKGSRC_GCC_VERSION will declare the |
version of gcc to be used for C programs, with an OS- and |
version of gcc to be used for C programs, with an OS-, |
version--specific default. |
version- and architeture- specific default. |
|
|
- A user-settable variable PKGSRC_GXX_VERSION will declare the |
- A user-settable variable PKGSRC_GXX_VERSION will declare the |
version of gcc to be used for all C++ programs, again with an OS- |
version of gcc to be used for all C++ programs, again with an OS-, |
and version-specific default. It must be at least |
version- and architeture-specific default. It must be at least |
PKGSRC_GCC_VERSION. |
PKGSRC_GCC_VERSION. |
|
|
|
- If PKGSRC_GCC_VERSION and PKGSRC_GXX_VERSION are not set, the |
|
system will behave much as before. As a possible exception, |
|
builds may still fail if the required version is greater than the |
|
base system version. So far the only known reason to avoid |
|
setting these variable is if pkgsrc gcc cannot be built. |
|
|
- Each of c99, c++, c++11, and c++14 will be associated with a |
- Each of c99, c++, c++11, and c++14 will be associated with a |
minimum gcc version, such that almost all programs declaring that |
minimum gcc version, such that almost all programs declaring that |
language can be built with that version. (This avoids issues of |
language can be built with that version. (This avoids issues of |
Line 132 sound while mimimizing complexity.
|
Line 142 sound while mimimizing complexity.
|
approach is possible inconsistency with gcc's dependencies being |
approach is possible inconsistency with gcc's dependencies being |
built with the base compiler and used later. |
built with the base compiler and used later. |
|
|
|
As an alternative, we store lists of bootstrap packages in a |
|
variable, because it will vary with OS and version, and with |
|
PREFER_PKGSRC settings. |
|
|
|
As a third alternative, we pass a GCC_BOOTSTRAPPING variable |
|
recursively. This is easier but less consistent. |
|
|
- We hope that the chosen version can be built using the base system |
- We hope that the chosen version can be built using the base system |
version, and hope to avoid multi-stage bootstrapping. |
version, and hope to avoid multi-stage bootstrapping. |
|
|
Line 149 For now, we defer worrying about these p
|
Line 166 For now, we defer worrying about these p
|
will be less serious than the current situation where all c++11 |
will be less serious than the current situation where all c++11 |
programs fail to build on NetBSD 6). |
programs fail to build on NetBSD 6). |
|
|
\todo: Change gcc 4.8 and 4.9 to enable gcc-inplace-math by default. |
\todo: Perhaps change gcc 4.8 and 4.9 to enable gcc-inplace-math by |
|
default. Perhaps decide that if we want to build gcc, we want to |
|
build 5 or 6, and 4.9 is no longer of interest as a bootstrap target. |
|
|
\todo: Analyze what build-time and install-time dependencies actually |
\todo: Analyze what build-time and install-time dependencies actually |
exist. Include old GNU/Linux in this analysis. |
exist. Include old GNU/Linux in this analysis. |
Line 220 failures.
|
Line 239 failures.
|
Therefore, the current answer to "What is the best version to use" is |
Therefore, the current answer to "What is the best version to use" is |
5. |
5. |
|
|
\todo Check this with Jason Bacon. |
|
|
|
### Default versions for various systems |
### Default versions for various systems |
|
|
Note that if for any particular system's set of installed packages (or |
Note that if for any particular system's set of installed packages (or |
Line 280 fortran, we should require a single vers
|
Line 297 fortran, we should require a single vers
|
|
|
\todo Discuss. |
\todo Discuss. |
|
|
### C++ programs used by C programs |
### C++ libraries used by C programs |
|
|
The choice of one version for C++ and one for C (e.g. 5, 4.8 on |
The choice of one version for C++ and one for C (e.g. 5, 4.8 on |
netbsd-7) breaks down if a C program links against a library that is |
netbsd-7) breaks down if a C program links against a library that is |
Line 294 to really just have one compiler version
|
Line 311 to really just have one compiler version
|
|
|
## Path forward |
## Path forward |
|
|
|
(This assumes per-package marking of bootstrap packages, but is |
|
reasonably obviously extended to the other schemes.) |
|
|
- Modify all gcc packages to have minimal dependencies, and to add |
- Modify all gcc packages to have minimal dependencies, and to add |
PKGSRC_GCC_BOOTSTRAP. |
PKGSRC_GCC_BOOTSTRAP. |
|
|
Line 303 to really just have one compiler version
|
Line 323 to really just have one compiler version
|
- Modify the compiler selection logic for LANGUAGES= to fail if |
- Modify the compiler selection logic for LANGUAGES= to fail if |
PKGSRC_GCC_VERSION/PKGSRC_GXX_VERSION is not new enough. |
PKGSRC_GCC_VERSION/PKGSRC_GXX_VERSION is not new enough. |
|
|
- Modify the compiler selection logic for GCC_REQD to fail if the |
- Modify the compiler selection logic for GCC_REQD to fail if |
version of GCC/GXX is not new enough. |
PKGSRC_GCC_VERSION/PKGSRC_GXX_VERSION is not new enough. |
|
|
- Decide on defaults. The straw proposal is that PKGSRC_GCC_VERSION |
- Decide on defaults. The straw proposal is that PKGSRC_GCC_VERSION |
is the base system version if >= 4.5 (or 4.4?), and otherwise 5, |
is the base system version if >= 4.5 (or 4.4?), and otherwise 5, |
and that PKGSRC_GXX_VERSION is the base system version if >= 5, and |
and that PKGSRC_GXX_VERSION is the base system version if >= 5, and |
otherwise 5. |
otherwise 5. Implement these in platform.mk as they are tested. |
|
|
### Later steps |
### Later steps |
|
|
- Address fortran. |
- Address fortran. Probably add PKGSRC_GFORTRAN_VERSION, after |
|
determining how Fortran, C and C++ interact with library ABI |
|
compatibility. |