pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: infer GCC_REQD from USE_LANGUAGES



On 1/15/19 11:53 AM, Edgar Fuß wrote:
Mixing GCC versions doesn't work well.
Yes. Therefore, that's exactly what my proposes solution/patch avoids.

To repeat my proposal:
1. Choose /the one single GCC version/ to build everything with (besides
    that GCC itself, of course. Provide defaults for OS/version combinations,
    let user override (once for the whole build).
2. Infer (additional) GCC_REQD values from USE_LANGUAGES.
3. Error out in case GCC_REQD sums up to a higher GCC that what was chosen.
4. Build with the GCC version chosen.

Open questions:
1. Building GCC may build libraries with a lower GCC than the rest.
    Can we re-use them or do we need to build them into another PREFIX?
I've had no issues that I could trace to using packages built with the "base" (Yum) gcc on CentOS.  I cannot speak for other platforms, though.  Here's a list of what I build with Yum GCC:

.if     empty(PKGPATH:Marchivers/bzip2) && \
    empty(PKGPATH:Marchivers/pax) && \
    empty(PKGPATH:Marchivers/xz) && \
    empty(PKGPATH:Mconverters/help2man) && \
    empty(PKGPATH:Mconverters/libiconv) && \
    empty(PKGPATH:Mconverters/p5-Unicode-EastAsianWidth) && \
    empty(PKGPATH:Mdevel/autoconf) && \
    empty(PKGPATH:Mdevel/binutils) && \
    empty(PKGPATH:Mdevel/gettext-lib) && \
    empty(PKGPATH:Mdevel/gettext-tools) && \
    empty(PKGPATH:Mdevel/gmake) && \
    empty(PKGPATH:Mdevel/gmp) && \
    empty(PKGPATH:Mdevel/gtexinfo) && \
    empty(PKGPATH:Mdevel/pkgconf) && \
    empty(PKGPATH:Mdevel/libtool-base) && \
    empty(PKGPATH:Mdevel/m4) && \
    empty(PKGPATH:Mdevel/ncurses) && \
    empty(PKGPATH:Mdevel/nbpatch) && \
    empty(PKGPATH:Mdevel/p5-gettext) && \
    empty(PKGPATH:Mlang/gcc6) && \
    empty(PKGPATH:Mlang/gcc6-libs) && \
    empty(PKGPATH:Mlang/perl5) && \
    empty(PKGPATH:Mmath/cloog) && \
    empty(PKGPATH:Mmath/isl) && \
    empty(PKGPATH:Mmath/mpcomplex) && \
    empty(PKGPATH:Mmath/mpfr) && \
    empty(PKGPATH:Mmisc/p5-Locale-libintl) && \
    empty(PKGPATH:Mnet/libfetch) && \
    empty(PKGPATH:Mpkgtools/cwrappers) && \
    empty(PKGPATH:Mpkgtools/digest) && \
    empty(PKGPATH:Mpkgtools/pkg_install-info) && \
    empty(PKGPATH:Mpkgtools/pkgin) && \
    empty(PKGPATH:Msysutils/checkperms) && \
    empty(PKGPATH:Mtextproc/gsed) && \
    empty(PKGPATH:Mtextproc/p5-Text-Unidecode)

GCC_REQD+=6.0

.endif  # GCC_REQD
2. The base GCC version may be unable to build the target GCC, we may need to
    build an intermediate version. This may build dependencies we need to
    discard/put into an interim PREFIX.
I think simply patching to allow builds with the base GCC should be feasible in most cases.  Everything up through gcc7 still builds with the CentOS 6 GCC 4.4:

Linux pbulkc6.ceas  bacon ~ 1001: pkgin avail|grep gcc
cloog-0.18.4         Code generator for loop optimization (used by gcc)
cross-arm-none-eabi-gcc-8.1.0 GCC for bare metal ARM EABI
cross-pdp11-aout-gcc-7.1.0nb1 GCC for PDP-11 aout
gcc-mips-4.9.2nb3    The GNU Compiler Collection (GCC) - 4.9 for mips (especially playstation2)
gcc48-4.8.5nb5       The GNU Compiler Collection (GCC) - 4.8 Release Series
gcc48-libs-4.8.5nb5  The GNU Compiler Collection (GCC) support shared libraries.
gcc49-4.9.4nb6       The GNU Compiler Collection (GCC) - 4.9 Release Series
gcc49-libs-4.9.4nb7  The GNU Compiler Collection (GCC) support shared libraries
gcc5-5.5.0nb1        The GNU Compiler Collection (GCC) - 5 Release Series
gcc5-libs-5.5.0nb1   The GNU Compiler Collection (GCC) support shared libraries
gcc6-6.4.0nb2        The GNU Compiler Collection (GCC) - 6 Release Series
gcc6-libs-6.4.0nb2   The GNU Compiler Collection (GCC) support shared libraries
gcc7-7.3.0nb1        The GNU Compiler Collection (GCC) - 7.0 Release Series
gcc7-libs-7.3.0nb2   The GNU Compiler Collection (GCC) support shared libraries
gccmakedep-1.0.3     Create dependencies in Makefiles using gcc
isl-0.17.1           Integer set library required by gcc graphite
mingw-w64-i686-gcc-bootstrap-8.1.0 GNU C Compiler for win32 cross-development (for bootstrap) mingw-w64-x86_64-gcc-bootstrap-8.1.0 GNU C Compiler for win64 cross-development (for bootstrap)
Linux pbulkc6.ceas  bacon ~ 1002: gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Here's the tail of my last pbulk log for gcc8, which I haven't had time to investigate:

/tmp/pkgbuild/lang/gcc8/work/build/./prev-gcc/xg++ -B/tmp/pkgbuild/lang/gcc8/work/build/./prev-gcc/ -B/sharedapps/pkg-2018Q4/gcc8/x86_64-redhat-linux/bin/ -nostdinc++ -B/tmp/pkgbuild/lang/gcc8/work/build/prev-x86_64-redhat-linux/libstdc++-v3/src/.libs -B/tmp/pkgbuild/lang/gcc8/work/build/prev-x86_64-redhat-linux/libstdc++-v3/libsupc++/.libs -I/tmp/pkgbuild/lang/gcc8/work/build/prev-x86_64-redhat-linux/libstdc++-v3/include/x86_64-redhat-linux -I/tmp/pkgbuild/lang/gcc8/work/build/prev-x86_64-redhat-linux/libstdc++-v3/include -I/tmp/pkgbuild/lang/gcc8/work/gcc-8.2.0/libstdc++-v3/libsupc++ -L/tmp/pkgbuild/lang/gcc8/work/build/prev-x86_64-redhat-linux/libstdc++-v3/src/.libs -L/tmp/pkgbuild/lang/gcc8/work/build/prev-x86_64-redhat-linux/libstdc++-v3/libsupc++/.libs -fno-PIE -c  -DIN_GCC_FRONTEND -g -O2 -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../../gcc-8.2.0/gcc -I../../gcc-8.2.0/gcc/. -I../../gcc-8.2.0/gcc/../include -I../../gcc-8.2.0/gcc/../libcpp/include -I/tmp/pkgbuild/lang/gcc8/work/build/./gmp -I/tmp/pkgbuild/lang/gcc8/work/gcc-8.2.0/gmp -I/tmp/pkgbuild/lang/gcc8/work/build/./mpfr/src -I/tmp/pkgbuild/lang/gcc8/work/gcc-8.2.0/mpfr/src -I/tmp/pkgbuild/lang/gcc8/work/gcc-8.2.0/mpc/src -I../../gcc-8.2.0/gcc/../libdecnumber -I../../gcc-8.2.0/gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc-8.2.0/gcc/../libbacktrace -I/tmp/pkgbuild/lang/gcc8/work/build/./isl/include -I/tmp/pkgbuild/lang/gcc8/work/gcc-8.2.0/isl/include -I/sharedapps/pkg-2018Q4/include -I/usr/include -o cc1objplus-checksum.o -MT cc1objplus-checksum.o -MMD -MP -MF ./.deps/cc1objplus-checksum.TPo cc1objplus-checksum.c
/sharedapps/pkg-2018Q4/bin/gld: cannot find -lz
collect2: error: ld returned 1 exit status
make[3]: *** [lto1] Error 1
make[3]: *** Waiting for unfinished jobs....
/sharedapps/pkg-2018Q4/bin/gld: cannot find -lz
/sharedapps/pkg-2018Q4/bin/gld: cannot find -lz
collect2: error: ld returned 1 exit status
make[3]: *** [f951] Error 1
rm gcc.pod gfortran.pod
make[3]: Leaving directory `/tmp/pkgbuild/lang/gcc8/work/build/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/tmp/pkgbuild/lang/gcc8/work/build'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/tmp/pkgbuild/lang/gcc8/work/build'
make: *** [all] Error 2
*** Error code 2

Stop.
bmake[1]: stopped in /sharedapps/pkgsrc-2018Q4/lang/gcc8
*** Error code 1

Stop.
bmake: stopped in /sharedapps/pkgsrc-2018Q4/lang/gcc8


Open details:
1. Does it work to use a lower GCC for C-only packages?
    Benefit: don't need to build GCC if not building C++ packages.
2. Which GCC version do we regard as C++nn-capable?
3. Determine exact set of (recursive) GCC dependencies (varies with OS).
We had this discussion before and yes, a lower GCC for C should generally be OK, but probably not in every case.  I think this would be too complex and more trouble than it's worth.  I would just use the same tool chain for all compiled languages for the sake of simplicity and avoid creating more maintenance work for ourselves down the road.

Regards,

   JB


Home | Main Index | Thread Index | Old Index