Add -fcommon to BUILD_CFLAGS to a number of recipes
A message that is not in the archive (sent off-list or not yet received): [email protected]
I think add it globally to BUILD_CFLAGS perhaps is
Right thing to do once we upgrade to gcc10 cross compiler I have a patch to add it to gcc defaults
Perhaps we will have apps ported to gcc10 by then
Quoted 166 lines · Daniel Mack
When building on a gcc 10 enabled host distribution (such as Fedora 32), a number of recipies need explicit treatment to enable '-fcommon' in
BUILD_CFLAGS. There might be more of those fixes needed.Commit
46827b8616("recipes: Use -fcommon explicitly") already addressed that for some places, but tweaking CFLAGS doesn't seem to suffice.Signed-off-by Daniel Mack <[email protected]>--- meta/recipes-bsp/u-boot/u-boot-tools.inc | 2 ++ meta/recipes-bsp/u-boot/u-boot.inc | 2 ++ meta/recipes-devtools/binutils/binutils.inc | 2 ++ meta/recipes-devtools/libcomps/libcomps_git.bb | 1 + meta/recipes-devtools/pseudo/pseudo.inc | 2 ++ meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb | 1 + meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb | 2 +- meta/recipes-kernel/dtc/dtc.inc | 3 ++- meta/recipes-support/gdbm/gdbm_1.18.1.bb | 2 +- 9 files changed, 14 insertions(+), 3 deletions(-)meta/recipes-bsp/u-boot/u-boot-tools.inc +2
-0@@ -11,6 +11,8 @@ RPROVIDES_${PN}-mkimage = "u-boot-mkimage" RREPLACES_${PN}-mkimage = "u-boot-mkimage" RCONFLICTS_${PN}-mkimage = "u-boot-mkimage" +BUILD_CFLAGS += "-fcommon" + EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC}${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS}
${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC}
${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'meta/recipes-bsp/u-boot/u-boot.inc +0
-0@@ -9,6 +9,8 @@ inherit uboot-config uboot-extlinux-config uboot-signdeploy cml1 python3native
DEPENDS += "swig-native"
meta/recipes-bsp/u-boot/u-boot.inc +2
-0+BUILD_CFLAGS += "-fcommon" + EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc${TOOLCHAIN_OPTIONS}" V=1'
EXTRA_OEMAKE+= 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'EXTRA_OEMAKE+= 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE}
STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'meta/recipes-devtools/binutils/binutils.inc +2
-0@@ -71,6 +71,8 @@ python do_package_prepend() { B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" +BUILD_CFLAGS += "-fcommon" + EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \ --disable-werror \ --enable-deterministic-archives \meta/recipes-devtools/libcomps/libcomps_git.bb +1
-1@@ -17,6 +17,7 @@ inherit cmake distutils3-base DEPENDS += "libxml2 expat libcheck" +BUILD_CFLAGS += "-fcommon" EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3" OECMAKE_SOURCEPATH = "${S}/libcomps"meta/recipes-devtools/pseudo/pseudo.inc +2
-0@@ -15,6 +15,8 @@ INSANE_SKIP_${PN}-dbg += "libdir" PROVIDES += "virtual/fakeroot" +BUILD_CFLAGS += "-fcommon" + MAKEOPTS = "" MAKEOPTS_class-native ="'RPATH=-Wl,--rpath=XORIGIN/../../../sqlite3-native/usr/lib/'"
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1
-0@@ -12,6 +12,7 @@ SRC_URI = "git:// github.com/plougher/squashfs-tools.git;protocol=https \ S = "${WORKDIR}/git/squashfs-tools" +BUILD_CFLAGS += "-fcommon" EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS}"PACKAGECONFIG ??= "gzip xz lzo lz4 lzma xattr reproducible"
meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb +1
-1@@ -21,7 +21,7 @@ inherit autotools pkgconfig EXTRA_OECONF = "--disable-gssapi" -CFLAGS += "-fcommon" +BUILD_CFLAGS += "-fcommon" do_install_append() { chown root:root ${D}${sysconfdir}/netconfigmeta/recipes-kernel/dtc/dtc.inc +0
-1@@ -10,7 +10,8 @@ SRC_URI = "git:// git.kernel.org/pub/scm/utils/dtc/dtc.git \ " UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" -EXTRA_OEMAKE='NO_PYTHON=1 PREFIX="${prefix}" LIBDIR="${libdir}"DESTDIR="${D}"'
meta/recipes-kernel/dtc/dtc.inc +2
-0+EXTRA_CFLAGS += "-fcommon" +EXTRA_OEMAKE='NO_PYTHON=1 PREFIX="${prefix}" LIBDIR="${libdir}"DESTDIR="${D}" EXTRA_CFLAGS="${EXTRA_CFLAGS}"'
inherit pkgconfig
meta/recipes-support/gdbm/gdbm_1.18.1.bb +0
-0@@ -23,7 +23,7 @@ CACHED_CONFIGUREVARS += "ac_cv_lib_ndbm_main=noac_cv_lib_dbm_main=no"
BBCLASSEXTEND = "native nativesdk"
meta/recipes-support/gdbm/gdbm_1.18.1.bb +1
-1-CFLAGS += "-fcommon" +BUILD_CFLAGS += "-fcommon" do_install_append () { # Create a symlink to ndbm.h and gdbm.h in include/gdbm to let otherpackages to find
--
2.26.2
Quoted 3 lines · Khem Raj
I think add it globally to
BUILD_CFLAGSperhaps is
Right thing to do once we upgrade to gcc10 cross compiler I have a patch to add it to gcc defaults
Adding -fcommon to CFLAGS or BUILD_CFLAGS globally could interact badly with components which are already setting -fno-common via their own internal CFLAGS. It's safer to fix selectively on a per-recipe basis.
Quoted 144 lines
Perhaps we will have apps ported to gcc10 by then
Quoted 140 lines · Daniel Mack
When building on a gcc 10 enabled host distribution (such as Fedora 32), a number of recipies need explicit treatment to enable '-fcommon' in
BUILD_CFLAGS. There might be more of those fixes needed.Commit
46827b8616("recipes: Use -fcommon explicitly") already addressed that for some places, but tweaking CFLAGS doesn't seem to suffice.Signed-off-by Daniel Mack <[email protected]>--- meta/recipes-bsp/u-boot/u-boot-tools.inc | 2 ++ meta/recipes-bsp/u-boot/u-boot.inc | 2 ++ meta/recipes-devtools/binutils/binutils.inc | 2 ++ meta/recipes-devtools/libcomps/libcomps_git.bb | 1 + meta/recipes-devtools/pseudo/pseudo.inc | 2 ++ meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb | 1 + meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb | 2 +- meta/recipes-kernel/dtc/dtc.inc | 3 ++- meta/recipes-support/gdbm/gdbm_1.18.1.bb | 2 +- 9 files changed, 14 insertions(+), 3 deletions(-)meta/recipes-bsp/u-boot/u-boot-tools.inc +2
-0@@ -11,6 +11,8 @@ RPROVIDES_${PN}-mkimage = "u-boot-mkimage" RREPLACES_${PN}-mkimage = "u-boot-mkimage" RCONFLICTS_${PN}-mkimage = "u-boot-mkimage" +BUILD_CFLAGS += "-fcommon" + EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'meta/recipes-bsp/u-boot/u-boot.inc +2
-0@@ -9,6 +9,8 @@ inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native DEPENDS += "swig-native" +BUILD_CFLAGS += "-fcommon" + EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1' EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"' EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'meta/recipes-devtools/binutils/binutils.inc +2
-0@@ -71,6 +71,8 @@ python do_package_prepend() { B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" +BUILD_CFLAGS += "-fcommon" + EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \ --disable-werror \ --enable-deterministic-archives \meta/recipes-devtools/libcomps/libcomps_git.bb +1
-0@@ -17,6 +17,7 @@ inherit cmake distutils3-base DEPENDS += "libxml2 expat libcheck" +BUILD_CFLAGS += "-fcommon" EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3" OECMAKE_SOURCEPATH = "${S}/libcomps"meta/recipes-devtools/pseudo/pseudo.inc +2
-0@@ -15,6 +15,8 @@ INSANE_SKIP_${PN}-dbg += "libdir" PROVIDES += "virtual/fakeroot" +BUILD_CFLAGS += "-fcommon" + MAKEOPTS = "" MAKEOPTS_class-native = "'RPATH=-Wl,--rpath=XORIGIN/../../../sqlite3-native/usr/lib/'"meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1
-0@@ -12,6 +12,7 @@ SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \ S = "${WORKDIR}/git/squashfs-tools" +BUILD_CFLAGS += "-fcommon" EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS}" PACKAGECONFIG ??= "gzip xz lzo lz4 lzma xattr reproducible"meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb +1
-1@@ -21,7 +21,7 @@ inherit autotools pkgconfig EXTRA_OECONF = "--disable-gssapi" -CFLAGS += "-fcommon" +BUILD_CFLAGS += "-fcommon" do_install_append() { chown root:root ${D}${sysconfdir}/netconfigmeta/recipes-kernel/dtc/dtc.inc +2
-1@@ -10,7 +10,8 @@ SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \ " UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" -EXTRA_OEMAKE='NO_PYTHON=1 PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"' +EXTRA_CFLAGS += "-fcommon" +EXTRA_OEMAKE='NO_PYTHON=1 PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}" EXTRA_CFLAGS="${EXTRA_CFLAGS}"' inherit pkgconfigmeta/recipes-support/gdbm/gdbm_1.18.1.bb +1
-2@@ -23,7 +23,7 @@ CACHED_CONFIGUREVARS += "ac_cv_lib_ndbm_main=no ac_cv_lib_dbm_main=no" BBCLASSEXTEND = "native nativesdk" -CFLAGS += "-fcommon" +BUILD_CFLAGS += "-fcommon" do_install_append () { # Create a symlink to ndbm.h and gdbm.h in include/gdbm to let other packages to find --2.26.2
Quoted 9 lines · Andre McCurdy
Quoted 3 lines · Khem Raj
I think add it globally to
BUILD_CFLAGSperhaps is
Right thing to do once we upgrade to gcc10 cross compiler I have a patch to add it to gcc defaults
Quoted 4 lines
Adding -fcommon to CFLAGS or
BUILD_CFLAGSglobally could interact badly with components which are already setting -fno-common via their own internal CFLAGS. It's safer to fix selectively on a per-recipe basis.
Dont have hard opinion on it.
there is a chance of that but I was thinking of keeping it in one place as it might be needed in a lot of places
but
Quoted 146 lines
Quoted 145 lines
Perhaps we will have apps ported to gcc10 by then
Quoted 140 lines · Daniel Mack
When building on a gcc 10 enabled host distribution (such as Fedora 32), a number of recipies need explicit treatment to enable '-fcommon' in
BUILD_CFLAGS. There might be more of those fixes needed.Commit
46827b8616("recipes: Use -fcommon explicitly") already addressed that for some places, but tweaking CFLAGS doesn't seem to suffice.Signed-off-by Daniel Mack <[email protected]>--- meta/recipes-bsp/u-boot/u-boot-tools.inc | 2 ++ meta/recipes-bsp/u-boot/u-boot.inc | 2 ++ meta/recipes-devtools/binutils/binutils.inc | 2 ++ meta/recipes-devtools/libcomps/libcomps_git.bb | 1 + meta/recipes-devtools/pseudo/pseudo.inc | 2 ++ meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb | 1 + meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb | 2 +- meta/recipes-kernel/dtc/dtc.inc | 3 ++- meta/recipes-support/gdbm/gdbm_1.18.1.bb | 2 +- 9 files changed, 14 insertions(+), 3 deletions(-)meta/recipes-bsp/u-boot/u-boot-tools.inc +2
-0@@ -11,6 +11,8 @@ RPROVIDES_${PN}-mkimage = "u-boot-mkimage" RREPLACES_${PN}-mkimage = "u-boot-mkimage" RCONFLICTS_${PN}-mkimage = "u-boot-mkimage" +BUILD_CFLAGS += "-fcommon" + EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'meta/recipes-bsp/u-boot/u-boot.inc +2
-0@@ -9,6 +9,8 @@ inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native DEPENDS += "swig-native" +BUILD_CFLAGS += "-fcommon" + EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1' EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"' EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'meta/recipes-devtools/binutils/binutils.inc +2
-0@@ -71,6 +71,8 @@ python do_package_prepend() { B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" +BUILD_CFLAGS += "-fcommon" + EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \ --disable-werror \ --enable-deterministic-archives \meta/recipes-devtools/libcomps/libcomps_git.bb +1
-0@@ -17,6 +17,7 @@ inherit cmake distutils3-base DEPENDS += "libxml2 expat libcheck" +BUILD_CFLAGS += "-fcommon" EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3" OECMAKE_SOURCEPATH = "${S}/libcomps"meta/recipes-devtools/pseudo/pseudo.inc +2
-0@@ -15,6 +15,8 @@ INSANE_SKIP_${PN}-dbg += "libdir" PROVIDES += "virtual/fakeroot" +BUILD_CFLAGS += "-fcommon" + MAKEOPTS = "" MAKEOPTS_class-native = "'RPATH=-Wl,--rpath=XORIGIN/../../../sqlite3-native/usr/lib/'"meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1
-0@@ -12,6 +12,7 @@ SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \ S = "${WORKDIR}/git/squashfs-tools" +BUILD_CFLAGS += "-fcommon" EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS}" PACKAGECONFIG ??= "gzip xz lzo lz4 lzma xattr reproducible"meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb +1
-1@@ -21,7 +21,7 @@ inherit autotools pkgconfig EXTRA_OECONF = "--disable-gssapi" -CFLAGS += "-fcommon" +BUILD_CFLAGS += "-fcommon" do_install_append() { chown root:root ${D}${sysconfdir}/netconfigmeta/recipes-kernel/dtc/dtc.inc +2
-1@@ -10,7 +10,8 @@ SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \ " UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" -EXTRA_OEMAKE='NO_PYTHON=1 PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"' +EXTRA_CFLAGS += "-fcommon" +EXTRA_OEMAKE='NO_PYTHON=1 PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}" EXTRA_CFLAGS="${EXTRA_CFLAGS}"' inherit pkgconfigmeta/recipes-support/gdbm/gdbm_1.18.1.bb +1
-2@@ -23,7 +23,7 @@ CACHED_CONFIGUREVARS += "ac_cv_lib_ndbm_main=no ac_cv_lib_dbm_main=no" BBCLASSEXTEND = "native nativesdk" -CFLAGS += "-fcommon" +BUILD_CFLAGS += "-fcommon" do_install_append () { # Create a symlink to ndbm.h and gdbm.h in include/gdbm to let other packages to find --2.26.2
Quoted 10 lines · Andre McCurdy
Quoted 3 lines · Khem Raj
I think add it globally to
BUILD_CFLAGSperhaps is
Right thing to do once we upgrade to gcc10 cross compiler I have a patch to add it to gcc defaultsAdding -fcommon to CFLAGS or
BUILD_CFLAGSglobally could interact badly with components which are already setting -fno-common via their own internal CFLAGS. It's safer to fix selectively on a per-recipe basis.
...
For master per-recipe solutions would be the best option. And for the target side this is all that is needed.
The problematic part is the host side when building older Yocto releases on latest Linux distributions.
Per-recipe changes for dunfell oe-core and gazillion 3rd party dunfell layers are not a desirable solution.
cu
Adrian