tech-pkg archive

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

Re: default C versions



On 6/28/23 17:35, Greg Troxel wrote:
 From recent commit messages where Taylor (probably) fixed libuv building
on EL7, I wonder if there is a systematic way to avoid these issues.
As I understand it code in EL7 was frozen in 2013 or maybe 2012, so it's
"wicked old" as we say in Boston.


My understanding is hazy, but since I haven't seen anything on the list,
I think:

   Lots of packages probably need a C99 compiler, but aren't tagged as
   such -- because pretty much every system has a C99 compiler and
   compiles in C99 by default, because in 2023, C99 is beyond normal.

   I am guessing EL7 uses a compiler that uses C90 (== C89) by default.

   It seems obviously buggy in the larger ecosystem that different
   compilers have different defaults in terms of which language they are
   compiling for (unapologetically taking the view that C is a language
   family and C99 is a language).

and thus I wonder if the wrappers should be passing --std=c90 when there
is no c99 or higher in USE_LANGUAGES.  That would in theory cause
packages that need c99 to fail even when c99 is default, which would get
the mis-tagging of USE_LANGUAGES fixed earlier.

An alternative would be to declare that c99 is normal and c90 deficient
and have the wrappers on systems with really old compilers add
--std=c99, which is sort of like putting c99 in the default
USE_LANGUAGES, but messier, and that doesn't seem great to do ad hoc.

This is a half-baked idea, and I am curious what others think.

We've had similar discussions before, and I'd remind everyone about the
risks and complexities of mixing multiple GCC versions in unpredictable
ways.

My "solution" when I started using pkgsrc on CentOS 6 years ago was to
use the base compiler only to build a pkgsrc GCC and its dependencies,
and use the pkgsrc GCC for all other packages.  The dependency list has
grown and keeping it updated has been a very minor nuisance, but I still
consider this the least horrid workaround for obsolete base compilers.

The list of GCC deps could be auto-generated to ease the burden.

auto-pkgsrc-setup currently generates the following:

.if \\
    empty(PKGPATH:Marchivers/bsdtar) && \\
    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:Mdatabases/db4) && \\
    empty(PKGPATH:Mdevel/autoconf) && \\
    empty(PKGPATH:Mdevel/binutils) && \\
    empty(PKGPATH:Mdevel/bison) && \\
    empty(PKGPATH:Mdevel/flex) && \\
    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/libffi) && \\
    empty(PKGPATH:Mdevel/libtool-base) && \\
    empty(PKGPATH:Mdevel/libuuid) && \\
    empty(PKGPATH:Mdevel/makedepend) && \\
    empty(PKGPATH:Mdevel/pkgconf) && \\
    empty(PKGPATH:Mdevel/m4) && \\
    empty(PKGPATH:Mdevel/ncurses) && \\
    empty(PKGPATH:Mdevel/nbpatch) && \\
    empty(PKGPATH:Mdevel/p5-CPAN-Meta) && \\
    empty(PKGPATH:Mdevel/p5-Module-Build) && \\
    empty(PKGPATH:Mdevel/p5-Perl4-CoreLibs) && \\
    empty(PKGPATH:Mdevel/p5-Scalar-List-Utils) && \\
    empty(PKGPATH:Mdevel/p5-gettext) && \\
    empty(PKGPATH:Mdevel/p5-inc-latest) && \\
    empty(PKGPATH:Mdevel/readline) && \\
    empty(PKGPATH:Mdevel/zlib) && \\
    empty(PKGPATH:Mlang/gcc*) && \\
    empty(PKGPATH:Mlang/perl5) && \\
    empty(PKGPATH:Mlang/python*) && \\
    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/mktools) && \\
    empty(PKGPATH:Mpkgtools/pkg_install) && \\
    empty(PKGPATH:Mpkgtools/pkg_install-info) && \\
    empty(PKGPATH:Mpkgtools/pkgin) && \\
    empty(PKGPATH:Msecurity/mozilla-rootcerts*) && \\
    empty(PKGPATH:Msecurity/openssl) && \\
    empty(PKGPATH:Msysutils/checkperms) && \\
    empty(PKGPATH:Mtextproc/gsed) && \\
    empty(PKGPATH:Mtextproc/p5-Text-Unidecode) && \\
    empty(PKGPATH:Mx11/xorgproto)

GCC_REQD+=$gcc_version
GFORTRAN_VERSION=$gcc_version

.endif  # GCC_REQD



Home | Main Index | Thread Index | Old Index