Skip to contentSkip to conversation

libcorrect: fix debug build

PATCH Superseded Fabrice Fontaine 2 participants 2 messages Nov 19, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libcorrect: fix debug build

If BR2_ENABLE_DEBUG is set, Debug release will be used and as a result -fsanitize=address will be added to CFLAGS which will fail on some toolchains because it requires asan library

So add -DCMAKE_BUILD_TYPE=Release unconditionally

Fixes:
- http://autobuild.buildroot.net/results/221d6a418e75b39fe645c3a56cee676518d2cff6

---
 package/libcorrect/libcorrect.mk | 2 ++
 1 file changed, 2 insertions(+)
package/libcorrect/libcorrect.mk +2 -0
index 0a84aa5c26..cb25e0d0cd 100644
@@ -9,5 +9,7 @@ LIBCORRECT_SITE = $(call github,quiet,libcorrect,$(LIBCORRECT_VERSION))
 LIBCORRECT_LICENSE = BSD-3-Clause
 LIBCORRECT_LICENSE_FILES = LICENSE
 LIBCORRECT_INSTALL_STAGING = YES
+# Debug release adds -fsanitize=address so always use Release
+LIBCORRECT_CONF_OPTS = -DCMAKE_BUILD_TYPE=Release
 
 $(eval $(cmake-package))
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 libcorrect: fix debug build

Hello,

Quoted 19 lines · Fabrice Fontaine

If BR2_ENABLE_DEBUG is set, Debug release will be used and as a result -fsanitize=address will be added to CFLAGS which will fail on some toolchains because it requires asan library

So add -DCMAKE_BUILD_TYPE=Release unconditionally

Fixes:
- http://autobuild.buildroot.net/results/221d6a418e75b39fe645c3a56cee676518d2cff6

---
 package/libcorrect/libcorrect.mk | 2 ++
 1 file changed, 2 insertions(+)
package/libcorrect/libcorrect.mk +0 -0
index 0a84aa5c26..cb25e0d0cd 100644

package/libcorrect/libcorrect.mk LIBCORRECT_SITE = $(call github,quiet,libcorrect,$(LIBCORRECT_VERSION)) · line 13

Quoted 5 lines
package/libcorrect/libcorrect.mk +2 -0
@@ -9,5 +9,7 @@ LIBCORRECT_SITE = $(call github,quiet,libcorrect,$(LIBCORRECT_VERSION))
 LIBCORRECT_LICENSE = BSD-3-Clause
 LIBCORRECT_LICENSE_FILES = LICENSE
 LIBCORRECT_INSTALL_STAGING = YES
+# Debug release adds -fsanitize=address so always use Release
+LIBCORRECT_CONF_OPTS = -DCMAKE_BUILD_TYPE=Release

This is a bit of a hack. What about making upstream check if -fsanitize=address is supported by the toolchain before using it ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com