Skip to contentSkip to conversation

libselinux: workaround gcc errors with '-O2'

PATCH New Mark Hatle 1 participant 1 message Nov 19, 2014

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 libselinux: workaround gcc errors with '-O2'

From: Wenzong Fan <[email protected]>

While building libselinux with oe-core toolchain and DEBUG_OPTIMIZATION enabled, the '-O' option may cause errors:

{standard input}: Assembler messages:
{standard input}:1910: Error: invalid operands \
(.text and *UND* sections) for `-'

Similar issue [YOCTO #5512]

---
 recipes-security/selinux/libselinux.inc | 5 +++++
 1 file changed, 5 insertions(+)
recipes-security/selinux/libselinux.inc +5 -0
index d571a7c..d2d01df 100644
@@ -23,6 +23,11 @@ EXTRA_OEMAKE += "${@get_policyconfigarch(d)}"
 
 EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lpcre'"
 
+# workaround gcc errors about:
+# {standard input}: Assembler messages:
+# {standard input}:1910: Error: invalid operands (.text and *UND* sections) for `-'
+CFLAGS += "-O2"
+
 do_compile_append() {
     oe_runmake pywrap -j1 \
             INCLUDEDIR='${STAGING_INCDIR}' \
Signature · 1 line
1.9.3