* [PATCH] sandbox: fix build failure with musl and SDL
@ 2022-01-21 17:00 Heinrich Schuchardt
2022-01-21 20:10 ` Milan P. Stanić
0 siblings, 1 reply; 6+ messages in thread
From: Heinrich Schuchardt @ 2022-01-21 17:00 UTC (permalink / raw)
To: Simon Glass; +Cc: u-boot, Heinrich Schuchardt, Milan P . Stanić
sdl.c is compiled against the SDL library.
Trying to redefine wchar_t with -fshort-wchar is not necessary
and leads to build failures when compiling against musl.
Cc: Milan P. Stanić <mps@arvanta.net>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
arch/sandbox/Makefile | 7 +++++++
arch/sandbox/cpu/Makefile | 11 ++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index f6cf859f24..0bdd322f12 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -4,3 +4,10 @@ head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o
head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
libs-y += arch/sandbox/cpu/
libs-y += arch/sandbox/lib/
+
+# sdl.c fails to compile with -fshort-wchar using musl.
+cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
+ $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
+
+$(obj)/sdl.o: $(src)/sdl.c FORCE
+ $(call if_changed_dep,cc_sdl.o)
diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index de7fe7f391..b74c866e56 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -7,7 +7,7 @@
obj-y := cache.o cpu.o state.o
extra-y := start.o os.o
-extra-$(CONFIG_SANDBOX_SDL) += sdl.o
+extra-$(CONFIG_SANDBOX_SDL) += sdl.o
obj-$(CONFIG_SPL_BUILD) += spl.o
obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o
@@ -19,8 +19,6 @@ cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \
$(obj)/os.o: $(src)/os.c FORCE
$(call if_changed_dep,cc_os.o)
-$(obj)/sdl.o: $(src)/sdl.c FORCE
- $(call if_changed_dep,cc_os.o)
# eth-raw-os.c is built in the system env, so needs standard includes
# CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path
@@ -30,3 +28,10 @@ cmd_cc_eth-raw-os.o = $(CC) $(filter-out -nostdinc, \
$(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE
$(call if_changed_dep,cc_eth-raw-os.o)
+
+# sdl.c fails to build with -fshort-wchar using musl
+cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
+ $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
+
+$(obj)/sdl.o: $(src)/sdl.c FORCE
+ $(call if_changed_dep,cc_sdl.o)
--
2.33.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] sandbox: fix build failure with musl and SDL
2022-01-21 17:00 [PATCH] sandbox: fix build failure with musl and SDL Heinrich Schuchardt
@ 2022-01-21 20:10 ` Milan P. Stanić
2022-01-27 21:35 ` Simon Glass
0 siblings, 1 reply; 6+ messages in thread
From: Milan P. Stanić @ 2022-01-21 20:10 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: Simon Glass, u-boot
Hi,
it works and build pass without error or warning.
Tested on alpine edge aarch64 bare metal.
Thank you
On Fri, 2022-01-21 at 18:00, Heinrich Schuchardt wrote:
> sdl.c is compiled against the SDL library.
>
> Trying to redefine wchar_t with -fshort-wchar is not necessary
> and leads to build failures when compiling against musl.
>
> Cc: Milan P. Stanić <mps@arvanta.net>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: Milan P. Stanić <mps@arvanta.net>
> ---
> arch/sandbox/Makefile | 7 +++++++
> arch/sandbox/cpu/Makefile | 11 ++++++++---
> 2 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
> index f6cf859f24..0bdd322f12 100644
> --- a/arch/sandbox/Makefile
> +++ b/arch/sandbox/Makefile
> @@ -4,3 +4,10 @@ head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o
> head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
> libs-y += arch/sandbox/cpu/
> libs-y += arch/sandbox/lib/
> +
> +# sdl.c fails to compile with -fshort-wchar using musl.
> +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
> + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
> +
> +$(obj)/sdl.o: $(src)/sdl.c FORCE
> + $(call if_changed_dep,cc_sdl.o)
> diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
> index de7fe7f391..b74c866e56 100644
> --- a/arch/sandbox/cpu/Makefile
> +++ b/arch/sandbox/cpu/Makefile
> @@ -7,7 +7,7 @@
>
> obj-y := cache.o cpu.o state.o
> extra-y := start.o os.o
> -extra-$(CONFIG_SANDBOX_SDL) += sdl.o
> +extra-$(CONFIG_SANDBOX_SDL) += sdl.o
> obj-$(CONFIG_SPL_BUILD) += spl.o
> obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o
>
> @@ -19,8 +19,6 @@ cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \
>
> $(obj)/os.o: $(src)/os.c FORCE
> $(call if_changed_dep,cc_os.o)
> -$(obj)/sdl.o: $(src)/sdl.c FORCE
> - $(call if_changed_dep,cc_os.o)
>
> # eth-raw-os.c is built in the system env, so needs standard includes
> # CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path
> @@ -30,3 +28,10 @@ cmd_cc_eth-raw-os.o = $(CC) $(filter-out -nostdinc, \
>
> $(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE
> $(call if_changed_dep,cc_eth-raw-os.o)
> +
> +# sdl.c fails to build with -fshort-wchar using musl
> +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
> + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
> +
> +$(obj)/sdl.o: $(src)/sdl.c FORCE
> + $(call if_changed_dep,cc_sdl.o)
> --
> 2.33.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sandbox: fix build failure with musl and SDL
2022-01-21 20:10 ` Milan P. Stanić
@ 2022-01-27 21:35 ` Simon Glass
2022-02-03 13:02 ` Milan P. Stanić
0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2022-01-27 21:35 UTC (permalink / raw)
To: Milan P. Stanić; +Cc: Heinrich Schuchardt, U-Boot Mailing List
Hi,
On Fri, 21 Jan 2022 at 13:11, Milan P. Stanić <mps@arvanta.net> wrote:
>
> Hi,
>
> it works and build pass without error or warning.
> Tested on alpine edge aarch64 bare metal.
>
> Thank you
>
> On Fri, 2022-01-21 at 18:00, Heinrich Schuchardt wrote:
> > sdl.c is compiled against the SDL library.
> >
> > Trying to redefine wchar_t with -fshort-wchar is not necessary
> > and leads to build failures when compiling against musl.
> >
> > Cc: Milan P. Stanić <mps@arvanta.net>
> > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>
> Tested-by: Milan P. Stanić <mps@arvanta.net>
>
> > ---
> > arch/sandbox/Makefile | 7 +++++++
> > arch/sandbox/cpu/Makefile | 11 ++++++++---
> > 2 files changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
> > index f6cf859f24..0bdd322f12 100644
> > --- a/arch/sandbox/Makefile
> > +++ b/arch/sandbox/Makefile
> > @@ -4,3 +4,10 @@ head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o
> > head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
> > libs-y += arch/sandbox/cpu/
> > libs-y += arch/sandbox/lib/
> > +
> > +# sdl.c fails to compile with -fshort-wchar using musl.
> > +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
> > + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
> > +
> > +$(obj)/sdl.o: $(src)/sdl.c FORCE
> > + $(call if_changed_dep,cc_sdl.o)
> > diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
> > index de7fe7f391..b74c866e56 100644
> > --- a/arch/sandbox/cpu/Makefile
> > +++ b/arch/sandbox/cpu/Makefile
> > @@ -7,7 +7,7 @@
> >
> > obj-y := cache.o cpu.o state.o
> > extra-y := start.o os.o
> > -extra-$(CONFIG_SANDBOX_SDL) += sdl.o
> > +extra-$(CONFIG_SANDBOX_SDL) += sdl.o
> > obj-$(CONFIG_SPL_BUILD) += spl.o
> > obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o
> >
> > @@ -19,8 +19,6 @@ cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \
> >
> > $(obj)/os.o: $(src)/os.c FORCE
> > $(call if_changed_dep,cc_os.o)
> > -$(obj)/sdl.o: $(src)/sdl.c FORCE
> > - $(call if_changed_dep,cc_os.o)
> >
> > # eth-raw-os.c is built in the system env, so needs standard includes
> > # CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path
> > @@ -30,3 +28,10 @@ cmd_cc_eth-raw-os.o = $(CC) $(filter-out -nostdinc, \
> >
> > $(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE
> > $(call if_changed_dep,cc_eth-raw-os.o)
> > +
> > +# sdl.c fails to build with -fshort-wchar using musl
> > +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
> > + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
> > +
> > +$(obj)/sdl.o: $(src)/sdl.c FORCE
> > + $(call if_changed_dep,cc_sdl.o)
> > --
> > 2.33.1
> >
This fails on gitlab.
https://source.denx.de/u-boot/custodians/u-boot-dm/-/jobs/382812
$ tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
--board ${TEST_PY_BD} ${OVERRIDE}
Building current source for 1 boards (1 thread, 40 jobs per thread)
sandbox: + sandbox
+/usr/bin/ld: error: LLVM gold plugin: linking module flags
'wchar_size': IDs have conflicting values in 'arch/sandbox/cpu/sdl.o'
and 'ld-temp.o'
+clang: error: linker command failed with exit code 1 (use -v to see invocation)
+make[1]: *** [Makefile:1799: u-boot] Error 1
+make: *** [Makefile:177: sub-make] Error 2
0 0 1 /1 sandbox
Completed: 1 total built, duration 0:00:22, rate 0.05
Running after_script
Please can you take a look?
Regards,
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sandbox: fix build failure with musl and SDL
2022-01-27 21:35 ` Simon Glass
@ 2022-02-03 13:02 ` Milan P. Stanić
2022-02-03 16:43 ` Tom Rini
0 siblings, 1 reply; 6+ messages in thread
From: Milan P. Stanić @ 2022-02-03 13:02 UTC (permalink / raw)
To: Simon Glass; +Cc: Heinrich Schuchardt, U-Boot Mailing List
Hi,
On Thu, 2022-01-27 at 14:35, Simon Glass wrote:
> Hi,
>
> On Fri, 21 Jan 2022 at 13:11, Milan P. Stanić <mps@arvanta.net> wrote:
> >
> > Hi,
> >
> > it works and build pass without error or warning.
> > Tested on alpine edge aarch64 bare metal.
> >
> > Thank you
> >
> > On Fri, 2022-01-21 at 18:00, Heinrich Schuchardt wrote:
> > > sdl.c is compiled against the SDL library.
> > >
> > > Trying to redefine wchar_t with -fshort-wchar is not necessary
> > > and leads to build failures when compiling against musl.
> > >
> > > Cc: Milan P. Stanić <mps@arvanta.net>
> > > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> >
> > Tested-by: Milan P. Stanić <mps@arvanta.net>
> >
> > > ---
> > > arch/sandbox/Makefile | 7 +++++++
> > > arch/sandbox/cpu/Makefile | 11 ++++++++---
> > > 2 files changed, 15 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
> > > index f6cf859f24..0bdd322f12 100644
> > > --- a/arch/sandbox/Makefile
> > > +++ b/arch/sandbox/Makefile
> > > @@ -4,3 +4,10 @@ head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o
> > > head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
> > > libs-y += arch/sandbox/cpu/
> > > libs-y += arch/sandbox/lib/
> > > +
> > > +# sdl.c fails to compile with -fshort-wchar using musl.
> > > +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
> > > + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
> > > +
> > > +$(obj)/sdl.o: $(src)/sdl.c FORCE
> > > + $(call if_changed_dep,cc_sdl.o)
> > > diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
> > > index de7fe7f391..b74c866e56 100644
> > > --- a/arch/sandbox/cpu/Makefile
> > > +++ b/arch/sandbox/cpu/Makefile
> > > @@ -7,7 +7,7 @@
> > >
> > > obj-y := cache.o cpu.o state.o
> > > extra-y := start.o os.o
> > > -extra-$(CONFIG_SANDBOX_SDL) += sdl.o
> > > +extra-$(CONFIG_SANDBOX_SDL) += sdl.o
> > > obj-$(CONFIG_SPL_BUILD) += spl.o
> > > obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o
> > >
> > > @@ -19,8 +19,6 @@ cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \
> > >
> > > $(obj)/os.o: $(src)/os.c FORCE
> > > $(call if_changed_dep,cc_os.o)
> > > -$(obj)/sdl.o: $(src)/sdl.c FORCE
> > > - $(call if_changed_dep,cc_os.o)
> > >
> > > # eth-raw-os.c is built in the system env, so needs standard includes
> > > # CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path
> > > @@ -30,3 +28,10 @@ cmd_cc_eth-raw-os.o = $(CC) $(filter-out -nostdinc, \
> > >
> > > $(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE
> > > $(call if_changed_dep,cc_eth-raw-os.o)
> > > +
> > > +# sdl.c fails to build with -fshort-wchar using musl
> > > +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
> > > + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
> > > +
> > > +$(obj)/sdl.o: $(src)/sdl.c FORCE
> > > + $(call if_changed_dep,cc_sdl.o)
> > > --
> > > 2.33.1
> > >
>
> This fails on gitlab.
>
> https://source.denx.de/u-boot/custodians/u-boot-dm/-/jobs/382812
>
> $ tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
> --board ${TEST_PY_BD} ${OVERRIDE}
> Building current source for 1 boards (1 thread, 40 jobs per thread)
> sandbox: + sandbox
> +/usr/bin/ld: error: LLVM gold plugin: linking module flags
> 'wchar_size': IDs have conflicting values in 'arch/sandbox/cpu/sdl.o'
> and 'ld-temp.o'
> +clang: error: linker command failed with exit code 1 (use -v to see invocation)
> +make[1]: *** [Makefile:1799: u-boot] Error 1
> +make: *** [Makefile:177: sub-make] Error 2
> 0 0 1 /1 sandbox
> Completed: 1 total built, duration 0:00:22, rate 0.05
> Running after_script
>
>
> Please can you take a look?
I tested with clang and lld, and clang ld.gold in lxc and bare metal
build. didn't had this errors.
Could be that this problem appears on docker only.
--
Kind regards
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sandbox: fix build failure with musl and SDL
2022-02-03 13:02 ` Milan P. Stanić
@ 2022-02-03 16:43 ` Tom Rini
2022-02-03 16:54 ` Heinrich Schuchardt
0 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2022-02-03 16:43 UTC (permalink / raw)
To: Milan P. Stanić
Cc: Simon Glass, Heinrich Schuchardt, U-Boot Mailing List
[-- Attachment #1: Type: text/plain, Size: 4382 bytes --]
On Thu, Feb 03, 2022 at 02:02:47PM +0100, Milan P. Stanić wrote:
> Hi,
>
> On Thu, 2022-01-27 at 14:35, Simon Glass wrote:
> > Hi,
> >
> > On Fri, 21 Jan 2022 at 13:11, Milan P. Stanić <mps@arvanta.net> wrote:
> > >
> > > Hi,
> > >
> > > it works and build pass without error or warning.
> > > Tested on alpine edge aarch64 bare metal.
> > >
> > > Thank you
> > >
> > > On Fri, 2022-01-21 at 18:00, Heinrich Schuchardt wrote:
> > > > sdl.c is compiled against the SDL library.
> > > >
> > > > Trying to redefine wchar_t with -fshort-wchar is not necessary
> > > > and leads to build failures when compiling against musl.
> > > >
> > > > Cc: Milan P. Stanić <mps@arvanta.net>
> > > > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> > >
> > > Tested-by: Milan P. Stanić <mps@arvanta.net>
> > >
> > > > ---
> > > > arch/sandbox/Makefile | 7 +++++++
> > > > arch/sandbox/cpu/Makefile | 11 ++++++++---
> > > > 2 files changed, 15 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
> > > > index f6cf859f24..0bdd322f12 100644
> > > > --- a/arch/sandbox/Makefile
> > > > +++ b/arch/sandbox/Makefile
> > > > @@ -4,3 +4,10 @@ head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o
> > > > head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
> > > > libs-y += arch/sandbox/cpu/
> > > > libs-y += arch/sandbox/lib/
> > > > +
> > > > +# sdl.c fails to compile with -fshort-wchar using musl.
> > > > +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
> > > > + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
> > > > +
> > > > +$(obj)/sdl.o: $(src)/sdl.c FORCE
> > > > + $(call if_changed_dep,cc_sdl.o)
> > > > diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
> > > > index de7fe7f391..b74c866e56 100644
> > > > --- a/arch/sandbox/cpu/Makefile
> > > > +++ b/arch/sandbox/cpu/Makefile
> > > > @@ -7,7 +7,7 @@
> > > >
> > > > obj-y := cache.o cpu.o state.o
> > > > extra-y := start.o os.o
> > > > -extra-$(CONFIG_SANDBOX_SDL) += sdl.o
> > > > +extra-$(CONFIG_SANDBOX_SDL) += sdl.o
> > > > obj-$(CONFIG_SPL_BUILD) += spl.o
> > > > obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o
> > > >
> > > > @@ -19,8 +19,6 @@ cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \
> > > >
> > > > $(obj)/os.o: $(src)/os.c FORCE
> > > > $(call if_changed_dep,cc_os.o)
> > > > -$(obj)/sdl.o: $(src)/sdl.c FORCE
> > > > - $(call if_changed_dep,cc_os.o)
> > > >
> > > > # eth-raw-os.c is built in the system env, so needs standard includes
> > > > # CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path
> > > > @@ -30,3 +28,10 @@ cmd_cc_eth-raw-os.o = $(CC) $(filter-out -nostdinc, \
> > > >
> > > > $(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE
> > > > $(call if_changed_dep,cc_eth-raw-os.o)
> > > > +
> > > > +# sdl.c fails to build with -fshort-wchar using musl
> > > > +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
> > > > + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
> > > > +
> > > > +$(obj)/sdl.o: $(src)/sdl.c FORCE
> > > > + $(call if_changed_dep,cc_sdl.o)
> > > > --
> > > > 2.33.1
> > > >
> >
> > This fails on gitlab.
> >
> > https://source.denx.de/u-boot/custodians/u-boot-dm/-/jobs/382812
> >
> > $ tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
> > --board ${TEST_PY_BD} ${OVERRIDE}
> > Building current source for 1 boards (1 thread, 40 jobs per thread)
> > sandbox: + sandbox
> > +/usr/bin/ld: error: LLVM gold plugin: linking module flags
> > 'wchar_size': IDs have conflicting values in 'arch/sandbox/cpu/sdl.o'
> > and 'ld-temp.o'
> > +clang: error: linker command failed with exit code 1 (use -v to see invocation)
> > +make[1]: *** [Makefile:1799: u-boot] Error 1
> > +make: *** [Makefile:177: sub-make] Error 2
> > 0 0 1 /1 sandbox
> > Completed: 1 total built, duration 0:00:22, rate 0.05
> > Running after_script
> >
> >
> > Please can you take a look?
>
> I tested with clang and lld, and clang ld.gold in lxc and bare metal
> build. didn't had this errors.
>
> Could be that this problem appears on docker only.
Docker is just an Ubuntu/Focal environment, so gcc + ld.gold here.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sandbox: fix build failure with musl and SDL
2022-02-03 16:43 ` Tom Rini
@ 2022-02-03 16:54 ` Heinrich Schuchardt
0 siblings, 0 replies; 6+ messages in thread
From: Heinrich Schuchardt @ 2022-02-03 16:54 UTC (permalink / raw)
To: Simon Glass, Tom Rini; +Cc: U-Boot Mailing List, Milan P. Stanić
On 2/3/22 17:43, Tom Rini wrote:
> On Thu, Feb 03, 2022 at 02:02:47PM +0100, Milan P. Stanić wrote:
>> Hi,
>>
>> On Thu, 2022-01-27 at 14:35, Simon Glass wrote:
>>> Hi,
>>>
>>> On Fri, 21 Jan 2022 at 13:11, Milan P. Stanić <mps@arvanta.net> wrote:
>>>>
>>>> Hi,
>>>>
>>>> it works and build pass without error or warning.
>>>> Tested on alpine edge aarch64 bare metal.
>>>>
>>>> Thank you
>>>>
>>>> On Fri, 2022-01-21 at 18:00, Heinrich Schuchardt wrote:
>>>>> sdl.c is compiled against the SDL library.
>>>>>
>>>>> Trying to redefine wchar_t with -fshort-wchar is not necessary
>>>>> and leads to build failures when compiling against musl.
>>>>>
>>>>> Cc: Milan P. Stanić <mps@arvanta.net>
>>>>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>>>>
>>>> Tested-by: Milan P. Stanić <mps@arvanta.net>
>>>>
>>>>> ---
>>>>> arch/sandbox/Makefile | 7 +++++++
>>>>> arch/sandbox/cpu/Makefile | 11 ++++++++---
>>>>> 2 files changed, 15 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
>>>>> index f6cf859f24..0bdd322f12 100644
>>>>> --- a/arch/sandbox/Makefile
>>>>> +++ b/arch/sandbox/Makefile
>>>>> @@ -4,3 +4,10 @@ head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o
>>>>> head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o
>>>>> libs-y += arch/sandbox/cpu/
>>>>> libs-y += arch/sandbox/lib/
>>>>> +
>>>>> +# sdl.c fails to compile with -fshort-wchar using musl.
>>>>> +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
>>>>> + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
>>>>> +
>>>>> +$(obj)/sdl.o: $(src)/sdl.c FORCE
>>>>> + $(call if_changed_dep,cc_sdl.o)
>>>>> diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
>>>>> index de7fe7f391..b74c866e56 100644
>>>>> --- a/arch/sandbox/cpu/Makefile
>>>>> +++ b/arch/sandbox/cpu/Makefile
>>>>> @@ -7,7 +7,7 @@
>>>>>
>>>>> obj-y := cache.o cpu.o state.o
>>>>> extra-y := start.o os.o
>>>>> -extra-$(CONFIG_SANDBOX_SDL) += sdl.o
>>>>> +extra-$(CONFIG_SANDBOX_SDL) += sdl.o
>>>>> obj-$(CONFIG_SPL_BUILD) += spl.o
>>>>> obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o
>>>>>
>>>>> @@ -19,8 +19,6 @@ cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \
>>>>>
>>>>> $(obj)/os.o: $(src)/os.c FORCE
>>>>> $(call if_changed_dep,cc_os.o)
>>>>> -$(obj)/sdl.o: $(src)/sdl.c FORCE
>>>>> - $(call if_changed_dep,cc_os.o)
>>>>>
>>>>> # eth-raw-os.c is built in the system env, so needs standard includes
>>>>> # CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path
>>>>> @@ -30,3 +28,10 @@ cmd_cc_eth-raw-os.o = $(CC) $(filter-out -nostdinc, \
>>>>>
>>>>> $(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE
>>>>> $(call if_changed_dep,cc_eth-raw-os.o)
>>>>> +
>>>>> +# sdl.c fails to build with -fshort-wchar using musl
>>>>> +cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
>>>>> + $(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
>>>>> +
>>>>> +$(obj)/sdl.o: $(src)/sdl.c FORCE
>>>>> + $(call if_changed_dep,cc_sdl.o)
>>>>> --
>>>>> 2.33.1
>>>>>
>>>
>>> This fails on gitlab.
>>>
>>> https://source.denx.de/u-boot/custodians/u-boot-dm/-/jobs/382812
>>>
>>> $ tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
>>> --board ${TEST_PY_BD} ${OVERRIDE}
>>> Building current source for 1 boards (1 thread, 40 jobs per thread)
>>> sandbox: + sandbox
>>> +/usr/bin/ld: error: LLVM gold plugin: linking module flags
>>> 'wchar_size': IDs have conflicting values in 'arch/sandbox/cpu/sdl.o'
>>> and 'ld-temp.o'
>>> +clang: error: linker command failed with exit code 1 (use -v to see invocation)
>>> +make[1]: *** [Makefile:1799: u-boot] Error 1
>>> +make: *** [Makefile:177: sub-make] Error 2
>>> 0 0 1 /1 sandbox
>>> Completed: 1 total built, duration 0:00:22, rate 0.05
>>> Running after_script
>>>
>>>
>>> Please can you take a look?
>>
>> I tested with clang and lld, and clang ld.gold in lxc and bare metal
>> build. didn't had this errors.
>>
>> Could be that this problem appears on docker only.
>
> Docker is just an Ubuntu/Focal environment, so gcc + ld.gold here.
>
Your are looking at an old version of the patch.
[PATCH v2 1/1] sandbox: fix build failure with musl and SDL
https://patchwork.ozlabs.org/project/uboot/patch/20220128090832.35509-1-heinrich.schuchardt@canonical.com/
@Simon
Could you, please, review.
Best regards
Heinrich
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-02-03 16:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21 17:00 [PATCH] sandbox: fix build failure with musl and SDL Heinrich Schuchardt
2022-01-21 20:10 ` Milan P. Stanić
2022-01-27 21:35 ` Simon Glass
2022-02-03 13:02 ` Milan P. Stanić
2022-02-03 16:43 ` Tom Rini
2022-02-03 16:54 ` Heinrich Schuchardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.