diff mbox series

[1/1] package/supertux: fix debug build on uclibc/musl

Message ID 20190526191814.3942-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/supertux: fix debug build on uclibc/musl | expand

Commit Message

Fabrice Fontaine May 26, 2019, 7:18 p.m. UTC
Always set CMAKE_BUILD_TYPE to Release otherwise supertux will be built
with -pg since:
https://github.com/SuperTux/supertux/commit/afd5f1b33c110104a7f286d6d7854157919a0a52

This will result in the following build failure on uclibc or musl:
[ 77%] Linking C executable sq_static
CMakeFiles/sq_static.dir/sq.c.o: In function `quit':
/home/buildroot/autobuild/instance-3/output/build/supertux-0.6.0/external/squirrel/sq/sq.c:42: undefined reference to `__gnu_mcount_nc'

Fixes:
 - http://autobuild.buildroot.org/results/b0b2e25af198d01713d1e2bcf38c77ae8ffbd7de

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/supertux/supertux.mk | 2 ++
 1 file changed, 2 insertions(+)

Comments

Thomas Petazzoni May 26, 2019, 7:45 p.m. UTC | #1
Hello,

+Arnout in Cc.

On Sun, 26 May 2019 21:18:14 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Always set CMAKE_BUILD_TYPE to Release otherwise supertux will be built
> with -pg since:
> https://github.com/SuperTux/supertux/commit/afd5f1b33c110104a7f286d6d7854157919a0a52
> 
> This will result in the following build failure on uclibc or musl:
> [ 77%] Linking C executable sq_static
> CMakeFiles/sq_static.dir/sq.c.o: In function `quit':
> /home/buildroot/autobuild/instance-3/output/build/supertux-0.6.0/external/squirrel/sq/sq.c:42: undefined reference to `__gnu_mcount_nc'
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/b0b2e25af198d01713d1e2bcf38c77ae8ffbd7de
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

So, it really seems like we want to stop using -DCMAKE_BUILD_TYPE=Debug
when BR2_ENABLE_DEBUG=y, like Arnout suggested in another thread.
Packages are adding random flags when -DCMAKE_BUILD_TYPE=Debug, it is
not really usable, as BR2_ENABLE_DEBUG should only mean "add -g to
CFLAGS".

Thomas
Arnout Vandecappelle May 26, 2019, 8:15 p.m. UTC | #2
On 26/05/2019 21:45, Thomas Petazzoni wrote:
> Hello,
> 
> +Arnout in Cc.
> 
> On Sun, 26 May 2019 21:18:14 +0200
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> 
>> Always set CMAKE_BUILD_TYPE to Release otherwise supertux will be built
>> with -pg since:
>> https://github.com/SuperTux/supertux/commit/afd5f1b33c110104a7f286d6d7854157919a0a52
>>
>> This will result in the following build failure on uclibc or musl:
>> [ 77%] Linking C executable sq_static
>> CMakeFiles/sq_static.dir/sq.c.o: In function `quit':
>> /home/buildroot/autobuild/instance-3/output/build/supertux-0.6.0/external/squirrel/sq/sq.c:42: undefined reference to `__gnu_mcount_nc'
>>
>> Fixes:
>>  - http://autobuild.buildroot.org/results/b0b2e25af198d01713d1e2bcf38c77ae8ffbd7de
>>
>> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> 
> So, it really seems like we want to stop using -DCMAKE_BUILD_TYPE=Debug
> when BR2_ENABLE_DEBUG=y, like Arnout suggested in another thread.

 I guess that means you agree with my analysis then? :-)

 Note, however, that the current patch can go to master, while the change of
build type is definitely *not* for master...

 [Or maybe I misread your statement, I thought you meant that Fabrice should
drop this patch and instead globally set build type to Release.]

 Regards,
 Arnout

> Packages are adding random flags when -DCMAKE_BUILD_TYPE=Debug, it is
> not really usable, as BR2_ENABLE_DEBUG should only mean "add -g to
> CFLAGS".
> 
> Thomas
>
Arnout Vandecappelle May 27, 2019, 9:50 p.m. UTC | #3
On 26/05/2019 21:18, Fabrice Fontaine wrote:
> Always set CMAKE_BUILD_TYPE to Release otherwise supertux will be built
> with -pg since:
> https://github.com/SuperTux/supertux/commit/afd5f1b33c110104a7f286d6d7854157919a0a52
> 
> This will result in the following build failure on uclibc or musl:
> [ 77%] Linking C executable sq_static
> CMakeFiles/sq_static.dir/sq.c.o: In function `quit':
> /home/buildroot/autobuild/instance-3/output/build/supertux-0.6.0/external/squirrel/sq/sq.c:42: undefined reference to `__gnu_mcount_nc'
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/b0b2e25af198d01713d1e2bcf38c77ae8ffbd7de
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

 As predicted: Applied to master, thanks.

 Regards,
 Arnout

> ---
>  package/supertux/supertux.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/package/supertux/supertux.mk b/package/supertux/supertux.mk
> index af25509da8..5842b17ba4 100644
> --- a/package/supertux/supertux.mk
> +++ b/package/supertux/supertux.mk
> @@ -18,6 +18,7 @@ SUPERTUX_LICENSE_FILES = LICENSE.txt data/AUTHORS
>  SUPERTUX_DEPENDENCIES = host-pkgconf boost freetype libcurl libgl libglew libglu \
>  	libogg libpng libvorbis openal physfs sdl2 sdl2_image
>  
> +# CMAKE_BUILD_TYPE=Release: disable profiling code (-pg)
>  # ENABLE_BOOST_STATIC_LIBS=OFF: use boost shared libraries since supertux
>  # depends on !BR2_STATIC_LIBS and boost provide only shared libraries with
>  # BR2_SHARED_LIBS.
> @@ -28,6 +29,7 @@ SUPERTUX_DEPENDENCIES = host-pkgconf boost freetype libcurl libgl libglew libglu
>  # in physfs.h (CHECK_SYMBOL_EXISTS) doesn't work.
>  # ENABLE_OPENGLES2=OFF: Disable opengles2 for now.
>  SUPERTUX_CONF_OPTS += \
> +	-DCMAKE_BUILD_TYPE=Release \
>  	-DENABLE_BOOST_STATIC_LIBS=OFF \
>  	-DBUILD_DOCUMENTATION=OFF \
>  	-DENABLE_OPENGL=ON \
>
Peter Korsgaard June 6, 2019, 3:22 p.m. UTC | #4
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Always set CMAKE_BUILD_TYPE to Release otherwise supertux will be built
 > with -pg since:
 > https://github.com/SuperTux/supertux/commit/afd5f1b33c110104a7f286d6d7854157919a0a52

 > This will result in the following build failure on uclibc or musl:
 > [ 77%] Linking C executable sq_static
 > CMakeFiles/sq_static.dir/sq.c.o: In function `quit':
 > /home/buildroot/autobuild/instance-3/output/build/supertux-0.6.0/external/squirrel/sq/sq.c:42: undefined reference to `__gnu_mcount_nc'

 > Fixes:
 >  - http://autobuild.buildroot.org/results/b0b2e25af198d01713d1e2bcf38c77ae8ffbd7de

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2019.02.x, thanks.
diff mbox series

Patch

diff --git a/package/supertux/supertux.mk b/package/supertux/supertux.mk
index af25509da8..5842b17ba4 100644
--- a/package/supertux/supertux.mk
+++ b/package/supertux/supertux.mk
@@ -18,6 +18,7 @@  SUPERTUX_LICENSE_FILES = LICENSE.txt data/AUTHORS
 SUPERTUX_DEPENDENCIES = host-pkgconf boost freetype libcurl libgl libglew libglu \
 	libogg libpng libvorbis openal physfs sdl2 sdl2_image
 
+# CMAKE_BUILD_TYPE=Release: disable profiling code (-pg)
 # ENABLE_BOOST_STATIC_LIBS=OFF: use boost shared libraries since supertux
 # depends on !BR2_STATIC_LIBS and boost provide only shared libraries with
 # BR2_SHARED_LIBS.
@@ -28,6 +29,7 @@  SUPERTUX_DEPENDENCIES = host-pkgconf boost freetype libcurl libgl libglew libglu
 # in physfs.h (CHECK_SYMBOL_EXISTS) doesn't work.
 # ENABLE_OPENGLES2=OFF: Disable opengles2 for now.
 SUPERTUX_CONF_OPTS += \
+	-DCMAKE_BUILD_TYPE=Release \
 	-DENABLE_BOOST_STATIC_LIBS=OFF \
 	-DBUILD_DOCUMENTATION=OFF \
 	-DENABLE_OPENGL=ON \