* [PATCH] Makefile.am: filter -Wl,--no-undefined
@ 2019-11-18 21:56 Fabrice Fontaine
2019-11-18 22:18 ` Lucas De Marchi
0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2019-11-18 21:56 UTC (permalink / raw)
To: linux-modules; +Cc: Fabrice Fontaine
Commit 1d14ef82f4a3be741bcdf6b1c6d51ce9dce43567 does not completely fix
the build with python 3.8 as we still get link failure due to
'-z undefs' being ignored by some versions of ld.
Indeed, -z undefs was added by commit
97a232d7335f3bd0231fd9cd39455bde1d563922 in upstream binutils, and this
commit was first present in binutils 2.30.
So any toolchain using binutils version older than that won't have
-z undefs and will build fail on:
/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips-linux-gnu/5.3.0/../../../../mips-linux-gnu/bin/ld: warning: -z undefs ignored.
/home/naourr/work/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/aarch64_be-linux-gnu/7.3.1/../../../../aarch64_be-linux-gnu/bin/ld: warning: -z undefs ignored.
So filter -Wl,--no-undefined to fix the issue
Fixes:
- http://autobuild.buildroot.org/results/e9645d9969481b09f507f6e0d0b35faaa283eb60
- http://autobuild.buildroot.org/results/06a6d865b6b7d8ebd793bde214f4a4c40e0962e1
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Makefile.am | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 8e9c90d..47505c1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -173,7 +173,10 @@ CPYTHON_MODULE_CFLAGS = \
$(AM_CFLAGS) -DCPYTHON_COMPILING_IN_PYPY=0 \
$(PYTHON_NOWARN) $(PYTHON_CFLAGS) \
-fvisibility=default
-CPYTHON_MODULE_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared -Wl,-z,undefs
+# Filter -Wl,--no-undefined to fix build with python 3.8
+comma = ,
+CPYTHON_MODULE_LDFLAGS = $(subst -Wl$(comma)--no-undefined,,$(AM_LDFLAGS))
+CPYTHON_MODULE_LDFLAGS += -module -avoid-version -shared
if BUILD_PYTHON
pkgpyexec_LTLIBRARIES = \
--
2.24.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Makefile.am: filter -Wl,--no-undefined
2019-11-18 21:56 [PATCH] Makefile.am: filter -Wl,--no-undefined Fabrice Fontaine
@ 2019-11-18 22:18 ` Lucas De Marchi
2019-11-18 22:45 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Lucas De Marchi @ 2019-11-18 22:18 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: linux-modules, Thomas Petazzoni
On Mon, Nov 18, 2019 at 1:59 PM Fabrice Fontaine
<fontaine.fabrice@gmail.com> wrote:
>
> Commit 1d14ef82f4a3be741bcdf6b1c6d51ce9dce43567 does not completely fix
CC'ing Thomas.
Lucas De Marchi
> the build with python 3.8 as we still get link failure due to
> '-z undefs' being ignored by some versions of ld.
>
> Indeed, -z undefs was added by commit
> 97a232d7335f3bd0231fd9cd39455bde1d563922 in upstream binutils, and this
> commit was first present in binutils 2.30.
> So any toolchain using binutils version older than that won't have
> -z undefs and will build fail on:
>
> /home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips-linux-gnu/5.3.0/../../../../mips-linux-gnu/bin/ld: warning: -z undefs ignored.
>
> /home/naourr/work/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/aarch64_be-linux-gnu/7.3.1/../../../../aarch64_be-linux-gnu/bin/ld: warning: -z undefs ignored.
>
> So filter -Wl,--no-undefined to fix the issue
>
> Fixes:
> - http://autobuild.buildroot.org/results/e9645d9969481b09f507f6e0d0b35faaa283eb60
> - http://autobuild.buildroot.org/results/06a6d865b6b7d8ebd793bde214f4a4c40e0962e1
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Makefile.am | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 8e9c90d..47505c1 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -173,7 +173,10 @@ CPYTHON_MODULE_CFLAGS = \
> $(AM_CFLAGS) -DCPYTHON_COMPILING_IN_PYPY=0 \
> $(PYTHON_NOWARN) $(PYTHON_CFLAGS) \
> -fvisibility=default
> -CPYTHON_MODULE_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared -Wl,-z,undefs
> +# Filter -Wl,--no-undefined to fix build with python 3.8
> +comma = ,
> +CPYTHON_MODULE_LDFLAGS = $(subst -Wl$(comma)--no-undefined,,$(AM_LDFLAGS))
> +CPYTHON_MODULE_LDFLAGS += -module -avoid-version -shared
>
> if BUILD_PYTHON
> pkgpyexec_LTLIBRARIES = \
> --
> 2.24.0
>
--
Lucas De Marchi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Makefile.am: filter -Wl,--no-undefined
2019-11-18 22:18 ` Lucas De Marchi
@ 2019-11-18 22:45 ` Thomas Petazzoni
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2019-11-18 22:45 UTC (permalink / raw)
To: Lucas De Marchi; +Cc: Fabrice Fontaine, linux-modules
Hello Lucas,
On Mon, 18 Nov 2019 14:18:07 -0800
Lucas De Marchi <lucas.de.marchi@gmail.com> wrote:
> On Mon, Nov 18, 2019 at 1:59 PM Fabrice Fontaine
> <fontaine.fabrice@gmail.com> wrote:
> >
> > Commit 1d14ef82f4a3be741bcdf6b1c6d51ce9dce43567 does not completely fix
>
> CC'ing Thomas.
>
> Lucas De Marchi
Fabrice also submitted this patch to Buildroot, and I merged it.
Indeed, the -z undefs option was only introduced in binutils 2.30, so
any toolchain using a binutils older than that is not able to use -z
undefs.
So I'd say that Fabrice's proposal is fine. Another option would be to
detect if the toolchain support -z undefs, and only use --no-undefined
if -z undefs is supported, for example.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-18 22:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 21:56 [PATCH] Makefile.am: filter -Wl,--no-undefined Fabrice Fontaine
2019-11-18 22:18 ` Lucas De Marchi
2019-11-18 22:45 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).