Fix -latomic for CMake packages
authorGleb Mazovetskiy <glex.spb@gmail.com>
Tue, 13 Apr 2021 06:26:14 +0000 (07:26 +0100)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sat, 1 May 2021 13:00:18 +0000 (15:00 +0200)
The poppler package failed to build for me with errors such as this one:

    host/aarch64-buildroot-linux-gnu/include/c++/10.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
       75 | #include_next <stdlib.h>
          |               ^~~~~~~~~~

Changing the CMake option to a link-specific one fixes the issue.

Also change other packages with the same issue: cutelyst, gerbera,
kf5-modemmanager-qt, kodi and wampcc.

Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/cutelyst/cutelyst.mk
package/gerbera/gerbera.mk
package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
package/kodi/kodi.mk
package/poppler/poppler.mk
package/wampcc/wampcc.mk

index 9520922454678bd34859bf40ebfeb1b24bbf5916..5313b003adbfe0bdbb2af370d6d1d6fd70f4563a 100644 (file)
@@ -18,7 +18,7 @@ CUTELYST_CONF_OPTS += \
 
 # Qt 5.8 needs atomics, which on various architectures are in -latomic
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-CUTELYST_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic"
+CUTELYST_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
 endif
 
 ifeq ($(BR2_PACKAGE_LIBPWQUALITY),y)
index 69d52e26777034275641cc2abe8492b1bf6a5431..b88fe8cc34c5192f85ecc034483dc7eed670afe4 100644 (file)
@@ -20,7 +20,7 @@ GERBERA_CONF_OPTS = -DWITH_DEBUG=OFF
 
 # Uses __atomic_fetch_add_4
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-GERBERA_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic"
+GERBERA_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
 endif
 
 ifeq ($(BR2_PACKAGE_DUKTAPE),y)
index 2a782b35e1aa26a009c60107051866afacec87a7..81617492c0bf5ea5287f637ce45e10ff67a6edee 100644 (file)
@@ -15,7 +15,7 @@ KF5_MODEMMANAGER_QT_INSTALL_STAGING = YES
 
 # Uses __atomic_fetch_add_4
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-KF5_MODEMMANAGER_QT_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic"
+KF5_MODEMMANAGER_QT_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
 endif
 
 $(eval $(cmake-package))
index 6edb0b7fcadcd953d9f313c4ab5fae1656befe81..b945534711ea061450b49078e00e8b41d420d385 100644 (file)
@@ -60,7 +60,6 @@ KODI_EXTRA_DOWNLOADS += \
 
 KODI_CONF_OPTS += \
        -DCMAKE_C_FLAGS="$(TARGET_CFLAGS) $(KODI_C_FLAGS)" \
-       -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) $(KODI_CXX_FLAGS)" \
        -DENABLE_APP_AUTONAME=OFF \
        -DENABLE_CCACHE=OFF \
        -DENABLE_DVDCSS=ON \
@@ -184,7 +183,7 @@ endif
 
 # mips: uses __atomic_load_8
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-KODI_CXX_FLAGS += -latomic
+KODI_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
 endif
 
 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5),)
index 44ad04bf7cd57effd47a75fbc95504ef1e62fa14..a5a97d974babd0baf6dbc3969b3dccdd9994b380 100644 (file)
@@ -21,7 +21,7 @@ POPPLER_CONF_OPTS = \
        -DENABLE_GTK_DOC=OFF
 
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-POPPLER_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic"
+POPPLER_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
 endif
 
 ifeq ($(BR2_PACKAGE_BOOST),y)
index 5e7ee036518fadacf695acc45f9659b82bd6231c..11bb1f90b541b3a9d7dc37c5d66580cf581ebe14 100644 (file)
@@ -13,7 +13,7 @@ WAMPCC_LICENSE_FILES = LICENSE
 
 # Uses __atomic_fetch_add_8
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
-WAMPCC_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic"
+WAMPCC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
 endif
 
 $(eval $(cmake-package))