• [gentoo-dev] Putting CC and CXX into make.conf

    From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to All on Thu Feb 9 14:10:01 2023
    Hi,

    I'd like to propose that we work towards having good defaults for CC
    and CXX variables in make.conf files. Something like:

    CC=${CHOST}-gcc
    CXX=${CHOST}-g++

    or:

    CC=${CHOST}-cc
    CXX=${CHOST}-c++

    Why?

    Right now we're pretty much relying on autoconf defaults: if CC/CXX is
    unset, autoconf looks for ${CHOST}-gcc and ${CHOST}-g++ appropriately. However, autoconf is only one of the many build systems (and no longer
    very popular, I'd say) and whenever apps use another build system or
    override the default lookup in autoconf, we need to 'tc-export CC CXX'
    in order to ensure that the right name is picked.

    Furthermore, some of us (myself included) actually set CC and CXX
    in their make.conf to a different value. As a result, they are exported already on our systems and it's hard for us to notice that our ebuilds
    are missing the tc-export call.

    I'm not aware of any downsides to having them set by default, except for
    the potentially problematic migration of existing systems.

    What are your thoughts?

    --
    Best regards,
    Michał Górny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Le Cuirot@21:1/5 to All on Thu Feb 9 14:20:01 2023
    On Thu, 2023-02-09 at 14:03 +0100, Michał Górny wrote:
    Hi,

    I'd like to propose that we work towards having good defaults for CC
    and CXX variables in make.conf files. Something like:

    CC=${CHOST}-gcc
    CXX=${CHOST}-g++

    or:

    CC=${CHOST}-cc
    CXX=${CHOST}-c++

    Why?

    Right now we're pretty much relying on autoconf defaults: if CC/CXX is
    unset, autoconf looks for ${CHOST}-gcc and ${CHOST}-g++ appropriately. However, autoconf is only one of the many build systems (and no longer
    very popular, I'd say) and whenever apps use another build system or
    override the default lookup in autoconf, we need to 'tc-export CC CXX'
    in order to ensure that the right name is picked.

    Furthermore, some of us (myself included) actually set CC and CXX
    in their make.conf to a different value. As a result, they are exported already on our systems and it's hard for us to notice that our ebuilds
    are missing the tc-export call.

    I'm not aware of any downsides to having them set by default, except for
    the potentially problematic migration of existing systems.

    What are your thoughts?

    I've long been surprised that CC/CXX are not exported when the FLAGS are. We already set these when cross-compiling or when using Clang, and that's been fine, so I really don't see any issue.

    -----BEGIN PGP SIGNATURE-----

    iQJFBAABCAAvFiEEPxcZ3tkwcedKm2a8EiZBXQDdMTcFAmPk8nARHGNoZXdpQGdl bnRvby5vcmcACgkQEiZBXQDdMTeHrBAAh4rg5gVtRpYBShen/xtunXOhvgKGMBE+ gBweymKE00BzJbIeNJhrKssXOHLlhRpyYkwFgfVH/o0W73cBqF5EvTCXBbDqFpZ5 iZyld5Px1LHX2nweyI1yulQu+hZik+MSVY5WJ8wE9wc8XPpY8g7rYW6VxbPgOkkN Ny/CaB2aQfK2RbRoTOFtL8zkmTiAxOzYSheg8c4yTP4/s3qDMCAkrURTlUBZGvNj G7UbYbPAnfYOfPjFDMD8XknHbcqZQ/9N5pl56y+fT02lEqFIH0KYdZ2mnmpYBB1n Piia9FuhIamrZsSlaoqF53lakQZp608yboXEXPZiC/mBz+VHsYAWAbO8C7bCvz5/ x2Sg94lrcukmucnpg8uVyW7kQPdGmNDRpaIWZHbsa2GECoC7oXSsK/7TrrSzomgm +I/PFuENfrDRZihrAhi4R+cJjAcYpYjMb3MH4GpEhtYJLpnCGu8gQotcJK7sjgHV hrRelJlShtjiNB/F12iMe2U4Lfa5ByEQMhlgC6otNs4YMMhMunVA4HRjgNRaxSOG AwnV9CFwY/fq3vBGJcdtN/jMXMGfduRJygms4TegdAplgrxDloKIogx/Ocle1mwd SDjKRy+iuJ/5Xh5yGoboBFz116CqBknTijXAjdpbt4qdGlfXy/7DThossj5L8BNy
    VH6t7JzAKjE=
    =WeTw
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)