public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] Add -fcommon to BUILD_CFLAGS to a number of recipes
@ 2020-05-03  8:26 daniel
  2020-05-03  8:32 ` ✗ patchtest: failure for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: daniel @ 2020-05-03  8:26 UTC (permalink / raw)
  To: openembedded-core; +Cc: 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 <daniel@zonque.org>
---
If there is a better way of doing this, please let me know. I needed
this patch to get my setup working again to F32.

 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(-)

diff --git a/meta/recipes-bsp/u-boot/u-boot-tools.inc b/meta/recipes-bsp/u-boot/u-boot-tools.inc
index 8ae290acc6..98c47bf399 100644
--- a/meta/recipes-bsp/u-boot/u-boot-tools.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-tools.inc
@@ -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'
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 188e5295cf..5fb1ae856a 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -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}'
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc
index 4119960c63..6d590658f8 100644
--- a/meta/recipes-devtools/binutils/binutils.inc
+++ b/meta/recipes-devtools/binutils/binutils.inc
@@ -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 \
diff --git a/meta/recipes-devtools/libcomps/libcomps_git.bb b/meta/recipes-devtools/libcomps/libcomps_git.bb
index 40b60159bc..0e893a9b49 100644
--- a/meta/recipes-devtools/libcomps/libcomps_git.bb
+++ b/meta/recipes-devtools/libcomps/libcomps_git.bb
@@ -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"
 
diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
index 50e30064bd..751f1815dc 100644
--- a/meta/recipes-devtools/pseudo/pseudo.inc
+++ b/meta/recipes-devtools/pseudo/pseudo.inc
@@ -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/'"
 
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
index 9bcf026ce2..3ab9b0f2e5 100644
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
+++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
@@ -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"
diff --git a/meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb b/meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb
index fc66821ecc..f600430c41 100644
--- a/meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb
+++ b/meta/recipes-extended/libtirpc/libtirpc_1.2.5.bb
@@ -21,7 +21,7 @@ inherit autotools pkgconfig
 
 EXTRA_OECONF = "--disable-gssapi"
 
-CFLAGS += "-fcommon"
+BUILD_CFLAGS += "-fcommon"
 
 do_install_append() {
 	chown root:root ${D}${sysconfdir}/netconfig
diff --git a/meta/recipes-kernel/dtc/dtc.inc b/meta/recipes-kernel/dtc/dtc.inc
index 0650e3c82e..6a5b5e5ef1 100644
--- a/meta/recipes-kernel/dtc/dtc.inc
+++ b/meta/recipes-kernel/dtc/dtc.inc
@@ -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 pkgconfig
 
diff --git a/meta/recipes-support/gdbm/gdbm_1.18.1.bb b/meta/recipes-support/gdbm/gdbm_1.18.1.bb
index 5cb7c558b8..5f55ab0ffb 100644
--- a/meta/recipes-support/gdbm/gdbm_1.18.1.bb
+++ b/meta/recipes-support/gdbm/gdbm_1.18.1.bb
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* ✗ patchtest: failure for Add -fcommon to BUILD_CFLAGS to a number of recipes
  2020-05-03  8:26 [PATCH] Add -fcommon to BUILD_CFLAGS to a number of recipes daniel
@ 2020-05-03  8:32 ` Patchwork
  2020-05-03 10:04 ` [OE-core] [PATCH] " Richard Purdie
  2020-05-03 20:00 ` Adrian Bunk
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2020-05-03  8:32 UTC (permalink / raw)
  To: Daniel Mack; +Cc: openembedded-core

== Series Details ==

Series: Add -fcommon to BUILD_CFLAGS to a number of recipes
Revision: 1
URL   : https://patchwork.openembedded.org/series/23916/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at e44ca998c2)

* Patch            Add -fcommon to BUILD_CFLAGS to a number of recipes
 Issue             Shortlog does not follow expected format [test_shortlog_format] 
  Suggested fix    Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] Add -fcommon to BUILD_CFLAGS to a number of recipes
  2020-05-03  8:26 [PATCH] Add -fcommon to BUILD_CFLAGS to a number of recipes daniel
  2020-05-03  8:32 ` ✗ patchtest: failure for " Patchwork
@ 2020-05-03 10:04 ` Richard Purdie
  2020-05-03 10:55   ` Daniel Mack
  2020-05-03 20:00 ` Adrian Bunk
  2 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2020-05-03 10:04 UTC (permalink / raw)
  To: openembedded-core; +Cc: Daniel Mack

On Sun, 2020-05-03 at 10:26 +0200, Daniel Mack wrote:
> 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.

Thanks for this, its definitely something we need to fid.

The work in the previous patch was fixing gcc 10 target builds, not
host. Your patch changes CFLAGS to BUILD_CFLAGS in places which means
when we upgrade to gcc 10 things will break.

Basically:

CFLAGS should cover build and target
TARGET_CFLAGS should cover target builds (gcc cross as gcc 10)
BUILD_CFLAGS should cover host tools (gcc 10 on the host)

so the correct place should be CFLAGS which should cover target and
build (host).

Its possible that some recipes build native and target components in
which case they might use CFLAGS and BUILD_CFLAGS. Based on what you
say in the commit message, there might be a bug and we might be missing
injecting CFLAGS into BUILD_CFLAGS.

I think this is going to need a little more investigation to get it
right.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] Add -fcommon to BUILD_CFLAGS to a number of recipes
  2020-05-03 10:04 ` [OE-core] [PATCH] " Richard Purdie
@ 2020-05-03 10:55   ` Daniel Mack
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Mack @ 2020-05-03 10:55 UTC (permalink / raw)
  To: openembedded-core

Hi Richard,

Thanks a lot for checking!


On 5/3/20 12:04 PM, Richard Purdie wrote:
> On Sun, 2020-05-03 at 10:26 +0200, Daniel Mack wrote:
>> 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.
> 
> Thanks for this, its definitely something we need to fid.
> 
> The work in the previous patch was fixing gcc 10 target builds, not
> host. Your patch changes CFLAGS to BUILD_CFLAGS in places which means
> when we upgrade to gcc 10 things will break.

Ah, I wasn't aware that cross-compilation is ready for gcc 10 yet. Okay,
that makes sense.

> Basically:
> 
> CFLAGS should cover build and target
> TARGET_CFLAGS should cover target builds (gcc cross as gcc 10)
> BUILD_CFLAGS should cover host tools (gcc 10 on the host)
> 
> so the correct place should be CFLAGS which should cover target and
> build (host).

I assumed that, yes, but at least for the recipes I addressed in my
patch, that doesn't cut it.

That said, there is also another patch needed for syslinux that doesn't
seem to allow injecting CFLAGS externally.

> Its possible that some recipes build native and target components in
> which case they might use CFLAGS and BUILD_CFLAGS. Based on what you
> say in the commit message, there might be a bug and we might be missing
> injecting CFLAGS into BUILD_CFLAGS.
> 
> I think this is going to need a little more investigation to get it
> right.

Alright. I'm happy to respin my patch or test alternative approaches.
After all, gcc 10 will have more exposure very soon with more
distributions are picking it up as default compiler.


Thanks,
Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] Add -fcommon to BUILD_CFLAGS to a number of recipes
  2020-05-03  8:26 [PATCH] Add -fcommon to BUILD_CFLAGS to a number of recipes daniel
  2020-05-03  8:32 ` ✗ patchtest: failure for " Patchwork
  2020-05-03 10:04 ` [OE-core] [PATCH] " Richard Purdie
@ 2020-05-03 20:00 ` Adrian Bunk
  2 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2020-05-03 20:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Daniel Mack

On Sun, May 03, 2020 at 10:26:40AM +0200, Daniel Mack wrote:
> 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.
>...

These are not fixes, just workarounds.
Adding upstream fixes would be preferable to adding workarounds. 

> --- a/meta/recipes-devtools/pseudo/pseudo.inc
> +++ b/meta/recipes-devtools/pseudo/pseudo.inc
> @@ -15,6 +15,8 @@ INSANE_SKIP_${PN}-dbg += "libdir"
>  
>  PROVIDES += "virtual/fakeroot"
>  
> +BUILD_CFLAGS += "-fcommon"
> +
>...

Yocto is upstream for pseudo, is there anything non-trivial required
for a proper fix?

> --- a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
> +++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
> @@ -12,6 +12,7 @@ SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \
>  
>  S = "${WORKDIR}/git/squashfs-tools"
>  
> +BUILD_CFLAGS += "-fcommon"
>...

The upstream fix is a trivial one-liner that should be backported instead:
https://github.com/plougher/squashfs-tools/commit/fe2f5da4b0f8994169c53e84b7cb8a0feefc97b5

cu
Adrian

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-03 20:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-03  8:26 [PATCH] Add -fcommon to BUILD_CFLAGS to a number of recipes daniel
2020-05-03  8:32 ` ✗ patchtest: failure for " Patchwork
2020-05-03 10:04 ` [OE-core] [PATCH] " Richard Purdie
2020-05-03 10:55   ` Daniel Mack
2020-05-03 20:00 ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox