#3 Use %set_build_flags macro to set CFLAGS/CXXFLAGS/LDFLAGS
Merged 2 months ago by kalev. Opened 3 months ago by kalev.
rpms/ kalev/0ad set-build-flags  into  rawhide

file removed
-33
@@ -1,33 +0,0 @@ 

- diff -up source/gui/tests/test_GuiManager.h.orig source/gui/tests/test_GuiManager.h

- --- source/gui/tests/test_GuiManager.h.orig	2021-02-23 13:49:05.427275704 -0300

- +++ source/gui/tests/test_GuiManager.h	2021-02-23 13:50:11.625669521 -0300

- @@ -151,12 +151,12 @@ public:

-  

-  		pageScriptInterface.GetProperty(global, "state_before", &js_hotkey_pressed_value);

-  		ScriptInterface::FromJSVal(prq, js_hotkey_pressed_value, hotkey_pressed_value);

- -		TS_ASSERT_EQUALS(hotkey_pressed_value, true);

- +		//TS_ASSERT_EQUALS(hotkey_pressed_value, true);

-  

-  		hotkey_pressed_value = false;

-  		pageScriptInterface.GetProperty(global, "state_after", &js_hotkey_pressed_value);

-  		ScriptInterface::FromJSVal(prq, js_hotkey_pressed_value, hotkey_pressed_value);

- -		TS_ASSERT_EQUALS(hotkey_pressed_value, true);

- +		//TS_ASSERT_EQUALS(hotkey_pressed_value, true);

-  

-  		// We are listening to KeyDown events, so repeat shouldn't matter.

-  		hotkeyNotification.ev.key.repeat = 1;

- @@ -167,12 +167,12 @@ public:

-  		hotkey_pressed_value = false;

-  		pageScriptInterface.GetProperty(global, "state_before", &js_hotkey_pressed_value);

-  		ScriptInterface::FromJSVal(prq, js_hotkey_pressed_value, hotkey_pressed_value);

- -		TS_ASSERT_EQUALS(hotkey_pressed_value, true);

- +		//TS_ASSERT_EQUALS(hotkey_pressed_value, true);

-  

-  		hotkey_pressed_value = false;

-  		pageScriptInterface.GetProperty(global, "state_after", &js_hotkey_pressed_value);

-  		ScriptInterface::FromJSVal(prq, js_hotkey_pressed_value, hotkey_pressed_value);

- -		TS_ASSERT_EQUALS(hotkey_pressed_value, true);

- +		//TS_ASSERT_EQUALS(hotkey_pressed_value, true);

-  

-  		hotkeyNotification.ev.type = SDL_KEYUP;

-  		in_push_priority_event(&hotkeyNotification);

file modified
+8 -10
@@ -27,7 +27,7 @@ 

  

  Name:		0ad

  Version:	0.0.24b

- Release:	1%{?dist}

+ Release:	2%{?dist}

  # BSD License:

  #	build/premake/*

  #	libraries/source/miniupnpc/*		(not built/used)
@@ -137,7 +137,6 @@ 

  Patch2:		%{name}-valgrind.patch

  # Fix build on ppc64le with patches from https://wiki.raptorcs.com/wiki/Porting/0ad

  Patch3:		%{name}-ppc64.patch

- Patch4:		%{name}-check.patch

  Patch5:		%{name}-rust.patch

  

  %description
@@ -162,7 +161,6 @@ 

  %endif

  %patch2 -p0

  %patch3 -p0

- %patch4 -p0

  %if %{without system_mozjs78}

  %patch5 -p0

  %endif
@@ -175,15 +173,11 @@ 

  

  #-----------------------------------------------------------------------

  %build

- # This package appears to get a multiply defined symbol during the LTO

- # link, but only on i686.  Disable LTO on that platform for now

- %ifarch i686

+ # LTO appears to break hotkey tests in GuiManager test suite.

+ # Disable LTO to fix the failing tests.

  %define _lto_cflags %{nil}

- %endif

  

- export CFLAGS="%{optflags}"

- # avoid warnings with gcc 4.7 due to _FORTIFY_SOURCE in CPPFLAGS

- export CPPFLAGS="`echo %{optflags} | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//'`"

+ %set_build_flags

  build/workspaces/update-workspaces.sh	\

      --bindir=%{_bindir}			\

      --datadir=%{_datadir}/%{name}	\
@@ -275,6 +269,10 @@ 

  %{_mandir}/man6/*.6*

  

  %changelog

+ * Sat Feb 27 2021 Kalev Lember <klember@redhat.com> - 0.0.24b-2

+ - Use set_build_flags macro to set CFLAGS/CXXFLAGS/LDFLAGS

+ - Disable LTO to fix self test failures

+ 

  * Mon Feb 22 2021 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.0.24b-1

  - Update to 0.0.24b

  

We need to call this manually as the build doesn't use any of the
standard %configure or %cmake or %meson macros that call
%set_build_flags.

Previously, the build was setting CFLAGS and CXXFLAGS, but not LDFLAGS,
which meant hardening flags weren't correctly passed to the linker and
flatpak builds didn't get -L/app/lib correctly set.

Calling %set_build_flags fixes both.

1 new commit added

  • Disable LTO to fix self test failures
3 months ago

I pushed another, unrelated fix to the same branch to avoid merge conflicts with two PRs.

Pull-Request has been merged by kalev

2 months ago
Metadata