Subject: Re: bug#52963: freedroidrpg: build failure

From: Efraim Flashner <[email-masked]>
Date: Wed, 2 Feb 2022 12:41:42 +0200

On Wed, Jan 05, 2022 at 11:58:20PM -0500, Leo Famulari wrote:
> On Sun, Jan 02, 2022 at 02:40:55PM -0500, Leo Famulari wrote:
> > On Sun, Jan 02, 2022 at 10:11:01AM -0900, Christopher Howard wrote:
> > > Package "freedroidrpg" fails to build:
> > [...]
> > > ld: addon_crafting_ui.o:(.bss+0x0): multiple definition of `tux_rendering'; action.o:(.bss+0x0): first defined here
> > 
> > I think we need to build the package with -fcommon. This is a typical
> > problem with unmaintained or old codebases, now that we have switched to
> > GCC 10.
> > 
> > Are you able to test it? Check the commit log for examples.
> 
> I tried this with the attached patch, but the build failed due to issues
> with how it finds SDL:

It looks like you missed the space after '/include/SDL' for sdl-mixer
when you added '-fcommon'. In any case, it's been fixed by Tobias so I'm
closing the bug.

> ------
> gcc -DHAVE_CONFIG_H -I. -I..  -DFD_DATADIR='"/gnu/store/kjwi84vzlgxxj0s19nsmfblpipk5rlm6-freedroidrpg-0.16.1/share/freedroidrpg"' -I../lua -DLOCALEDIR='"/gnu/store/kjwi84vzlgxxj0s19nsmfblpipk5rlm6-freedroidrpg-0.16.1/share/locale"'  -I/gnu/store/l4k60q5jm9g2f3jslnhjsldls0l4vf9q-sdl-1.2.15/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -pipe -Wall -Wno-format-zero-length -ffast-math -I/gnu/store/2qfzwl2k819cdp57xwikhp0i3sl27hma-sdl-gfx-2.0.26/include/SDL -I/gnu/store/h9b8d63bxyjd5hl1mdmicrvl4rhz87vp-sdl-image-1.2.12/include/SDL -I/gnu/store/4n31akz1025w8c9yjfa5mwf9b2q2vv83-sdl-mixer-1.2.12/include/SDL-fcommon -MT armor.o -MD -MP -MF $depbase.Tpo -c -o armor.o armor.c &&\
> mv -f $depbase.Tpo $depbase.Po
> In file included from struct.h:30,
>                  from animate.c:33:
> system.h:132:10: fatal error: SDL_mixer.h: No such file or directory
>   132 | #include <SDL_mixer.h>
>       |          ^~~~~~~~~~~~~
> In file included from struct.h:30,
>                  from addon_crafting_ui.c:24:
> system.h:132:10: fatal error: SDL_mixer.h: No such file or directory
>   132 | #include <SDL_mixer.h>
>       |          ^~~~~~~~~~~~~
> compilation terminated.
> compilation terminated.
> make[3]: *** [Makefile:663: addon_crafting_ui.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
> make[3]: *** [Makefile:663: animate.o] Error 1
> In file included from action.c:32:
> system.h:132:10: fatal error: SDL_mixer.h: No such file or directory
>   132 | #include <SDL_mixer.h>
>       |          ^~~~~~~~~~~~~
> compilation terminated.
> In file included from armor.c:25:
> system.h:132:10: fatal error: SDL_mixer.h: No such file or directory
>   132 | #include <SDL_mixer.h>
>       |          ^~~~~~~~~~~~~
> compilation terminated.
> make[3]: *** [Makefile:663: action.o] Error 1
> make[3]: *** [Makefile:663: armor.o] Error 1
> make[3]: Leaving directory '/tmp/guix-build-freedroidrpg-0.16.1.drv-0/freedroidrpg-0.16.1/src'
> make[2]: *** [Makefile:352: all] Error 2
> make[2]: Leaving directory '/tmp/guix-build-freedroidrpg-0.16.1.drv-0/freedroidrpg-0.16.1/src'
> make[1]: *** [Makefile:474: all-recursive] Error 1
> make[1]: Leaving directory '/tmp/guix-build-freedroidrpg-0.16.1.drv-0/freedroidrpg-0.16.1'
> make: *** [Makefile:354: all] Error 2
> error: in phase 'build': uncaught exception:
> %exception #<&invoke-error program: "make" arguments: ("-j" "4") exit-status: 2 term-signal: #f stop-signal: #f> 
> phase `build' failed after 2.6 seconds
> ------

> From 6c9bbda796c3528f018bd4590238aeebcbe81feb Mon Sep 17 00:00:00 2001
> From: Leo Famulari <[email-masked]>
> Date: Wed, 5 Jan 2022 23:54:33 -0500
> Subject: [PATCH] gnu: FreedroidRPG: Fix build with GCC 10?
> 
> * gnu/packages/games.scm (freedroidrpg)[arguments]: Add -fcommon to CFLAGS.
> ---
>  gnu/packages/games.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index bfd566aac0..e4ddcf8aea 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -1365,7 +1365,8 @@ (define-public freedroidrpg
>          (string-append "CFLAGS="
>                         "-I" (assoc-ref %build-inputs "sdl-gfx") "/include/SDL "
>                         "-I" (assoc-ref %build-inputs "sdl-image") "/include/SDL "
> -                       "-I" (assoc-ref %build-inputs "sdl-mixer") "/include/SDL")
> +                       "-I" (assoc-ref %build-inputs "sdl-mixer") "/include/SDL"
> +                       "-fcommon") ; Fix build with GCC 10
>          "--enable-opengl")
>         ;; FIXME: the test suite fails with the following error output:
>         ;;   4586 Segmentation fault      env SDL_VIDEODRIVER=dummy \
> -- 
> 2.34.0
> 

-- 
Efraim Flashner   <[email-masked]>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted