All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] Fix -latomic for CMake packages
@ 2021-04-13  6:09 Gleb Mazovetskiy
  2021-04-13  6:26 ` [Buildroot] [PATCH v2 " Gleb Mazovetskiy
  0 siblings, 1 reply; 11+ messages in thread
From: Gleb Mazovetskiy @ 2021-04-13  6:09 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
---
 package/cutelyst/cutelyst.mk                           | 2 +-
 package/gerbera/gerbera.mk                             | 2 +-
 package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk | 2 +-
 package/poppler/poppler.mk                             | 2 +-
 package/wampcc/wampcc.mk                               | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/cutelyst/cutelyst.mk b/package/cutelyst/cutelyst.mk
index 9520922454..5313b003ad 100644
--- a/package/cutelyst/cutelyst.mk
+++ b/package/cutelyst/cutelyst.mk
@@ -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)
diff --git a/package/gerbera/gerbera.mk b/package/gerbera/gerbera.mk
index ccb3b2eeb5..f75595a46d 100644
--- a/package/gerbera/gerbera.mk
+++ b/package/gerbera/gerbera.mk
@@ -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)
diff --git a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
index 2a782b35e1..81617492c0 100644
--- a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
+++ b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
@@ -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))
diff --git a/package/poppler/poppler.mk b/package/poppler/poppler.mk
index 44ad04bf7c..a5a97d974b 100644
--- a/package/poppler/poppler.mk
+++ b/package/poppler/poppler.mk
@@ -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)
diff --git a/package/wampcc/wampcc.mk b/package/wampcc/wampcc.mk
index 5e7ee03651..11bb1f90b5 100644
--- a/package/wampcc/wampcc.mk
+++ b/package/wampcc/wampcc.mk
@@ -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))
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-04-13  6:09 [Buildroot] [PATCH 1/1] Fix -latomic for CMake packages Gleb Mazovetskiy
@ 2021-04-13  6:26 ` Gleb Mazovetskiy
  2021-04-14 17:49   ` Peter Seiderer
  2021-05-01 13:02   ` Arnout Vandecappelle
  0 siblings, 2 replies; 11+ messages in thread
From: Gleb Mazovetskiy @ 2021-04-13  6:26 UTC (permalink / raw)
  To: buildroot

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.

---
Changes v1 -> v2
  - Also fix kodi
---
 package/cutelyst/cutelyst.mk                           | 2 +-
 package/gerbera/gerbera.mk                             | 2 +-
 package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk | 2 +-
 package/kodi/kodi.mk                                   | 2 +-
 package/poppler/poppler.mk                             | 2 +-
 package/wampcc/wampcc.mk                               | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/package/cutelyst/cutelyst.mk b/package/cutelyst/cutelyst.mk
index 9520922454..5313b003ad 100644
--- a/package/cutelyst/cutelyst.mk
+++ b/package/cutelyst/cutelyst.mk
@@ -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)
diff --git a/package/gerbera/gerbera.mk b/package/gerbera/gerbera.mk
index ccb3b2eeb5..f75595a46d 100644
--- a/package/gerbera/gerbera.mk
+++ b/package/gerbera/gerbera.mk
@@ -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)
diff --git a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
index 2a782b35e1..81617492c0 100644
--- a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
+++ b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
@@ -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))
diff --git a/package/kodi/kodi.mk b/package/kodi/kodi.mk
index 6edb0b7fca..28fe4a6a92 100644
--- a/package/kodi/kodi.mk
+++ b/package/kodi/kodi.mk
@@ -184,7 +184,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),)
diff --git a/package/poppler/poppler.mk b/package/poppler/poppler.mk
index 44ad04bf7c..a5a97d974b 100644
--- a/package/poppler/poppler.mk
+++ b/package/poppler/poppler.mk
@@ -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)
diff --git a/package/wampcc/wampcc.mk b/package/wampcc/wampcc.mk
index 5e7ee03651..11bb1f90b5 100644
--- a/package/wampcc/wampcc.mk
+++ b/package/wampcc/wampcc.mk
@@ -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))
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-04-13  6:26 ` [Buildroot] [PATCH v2 " Gleb Mazovetskiy
@ 2021-04-14 17:49   ` Peter Seiderer
  2021-04-15  3:49     ` Gleb Mazovetskiy
  2021-05-01 13:02   ` Arnout Vandecappelle
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Seiderer @ 2021-04-14 17:49 UTC (permalink / raw)
  To: buildroot

Hello Gleb,

On Tue, 13 Apr 2021 07:26:14 +0100, Gleb Mazovetskiy <glex.spb@gmail.com> wrote:

> 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.

Out of interest (as this is a compile not link failure), what is the actual
change in the compile parameter set?

Can you provide a (failing) defconfig?

Regards,
Peter

>
> ---
> Changes v1 -> v2
>   - Also fix kodi
> ---
>  package/cutelyst/cutelyst.mk                           | 2 +-
>  package/gerbera/gerbera.mk                             | 2 +-
>  package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk | 2 +-
>  package/kodi/kodi.mk                                   | 2 +-
>  package/poppler/poppler.mk                             | 2 +-
>  package/wampcc/wampcc.mk                               | 2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/package/cutelyst/cutelyst.mk b/package/cutelyst/cutelyst.mk
> index 9520922454..5313b003ad 100644
> --- a/package/cutelyst/cutelyst.mk
> +++ b/package/cutelyst/cutelyst.mk
> @@ -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)
> diff --git a/package/gerbera/gerbera.mk b/package/gerbera/gerbera.mk
> index ccb3b2eeb5..f75595a46d 100644
> --- a/package/gerbera/gerbera.mk
> +++ b/package/gerbera/gerbera.mk
> @@ -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)
> diff --git a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> index 2a782b35e1..81617492c0 100644
> --- a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> +++ b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> @@ -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))
> diff --git a/package/kodi/kodi.mk b/package/kodi/kodi.mk
> index 6edb0b7fca..28fe4a6a92 100644
> --- a/package/kodi/kodi.mk
> +++ b/package/kodi/kodi.mk
> @@ -184,7 +184,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),)
> diff --git a/package/poppler/poppler.mk b/package/poppler/poppler.mk
> index 44ad04bf7c..a5a97d974b 100644
> --- a/package/poppler/poppler.mk
> +++ b/package/poppler/poppler.mk
> @@ -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)
> diff --git a/package/wampcc/wampcc.mk b/package/wampcc/wampcc.mk
> index 5e7ee03651..11bb1f90b5 100644
> --- a/package/wampcc/wampcc.mk
> +++ b/package/wampcc/wampcc.mk
> @@ -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))

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-04-14 17:49   ` Peter Seiderer
@ 2021-04-15  3:49     ` Gleb Mazovetskiy
  2021-04-15 19:44       ` Peter Seiderer
  0 siblings, 1 reply; 11+ messages in thread
From: Gleb Mazovetskiy @ 2021-04-15  3:49 UTC (permalink / raw)
  To: buildroot

Hi Peter,

The failing defconfig is here (it's specific to this buildroot):
https://github.com/batocera-linux/batocera.linux/blob/8d8038a6ddaae03f0150fd28a2d23c371156ebf2/configs/batocera-odroidgoa_defconfig

Here is the compiler command without this change:

/usr/bin/ccache
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/bin/aarch64-buildroot-linux-gnu-g++
--sysroot=/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot
-Dpoppler_EXPORTS
-I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0
-I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/fofi
-I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/goo
-I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/poppler
*-isystem
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include*
-isystem
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/freetype2
-isystem
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/nss
-isystem
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/nspr
-Wall -Wextra -Wpedantic -Wno-unused-parameter -Wcast-align
-Wformat-security -Wframe-larger-than=65536 -Wlogical-op
-Wmissing-format-attribute -Wnon-virtual-dtor -Woverloaded-virtual
-Wmissing-declarations -Wundef -Wzero-as-null-pointer-constant -Wshadow
-Wsuggest-override -fno-exceptions -fno-check-new -fno-common
-D_DEFAULT_SOURCE -O2 -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 * -O3   -latomic -fPIC *-pthread -std=c++14 -MD -MT
CMakeFiles/poppler.dir/goo/gbase64.cc.o -MF
CMakeFiles/poppler.dir/goo/gbase64.cc.o.d -o
CMakeFiles/poppler.dir/goo/gbase64.cc.o -c
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/goo/gbase64.cc

With this change:

/usr/bin/ccache
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/bin/aarch64-buildroot-linux-gnu-g++
--sysroot=/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot
-Dpoppler_EXPORTS
-I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0
-I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/fofi
-I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/goo
-I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/poppler
-isystem
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/freetype2
-isystem
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/nss
-isystem
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/nspr
-Wall -Wextra -Wpedantic -Wno-unused-parameter -Wcast-align
-Wformat-security -Wframe-larger-than=65536 -Wlogical-op
-Wmissing-format-attribute -Wnon-virtual-dtor -Woverloaded-virtual
-Wmissing-declarations -Wundef -Wzero-as-null-pointer-constant -Wshadow
-Wsuggest-override -fno-exceptions -fno-check-new -fno-common
-D_DEFAULT_SOURCE -O2 -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 *-O3 -fPIC* -pthread -std=c++14 -MD -MT
CMakeFiles/poppler.dir/goo/gbase64.cc.o -MF
CMakeFiles/poppler.dir/goo/gbase64.cc.o.d -o
CMakeFiles/poppler.dir/goo/gbase64.cc.o -c
/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/goo/gbase64.cc

Notice that the first command has an extra include statement

On Wed, Apr 14, 2021 at 6:49 PM Peter Seiderer <ps.report@gmx.net> wrote:

> Hello Gleb,
>
> On Tue, 13 Apr 2021 07:26:14 +0100, Gleb Mazovetskiy <glex.spb@gmail.com>
> wrote:
>
> > 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.
>
> Out of interest (as this is a compile not link failure), what is the actual
> change in the compile parameter set?
>
> Can you provide a (failing) defconfig?
>
> Regards,
> Peter
>
> >
> > ---
> > Changes v1 -> v2
> >   - Also fix kodi
> > ---
> >  package/cutelyst/cutelyst.mk                           | 2 +-
> >  package/gerbera/gerbera.mk                             | 2 +-
> >  package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk | 2 +-
> >  package/kodi/kodi.mk                                   | 2 +-
> >  package/poppler/poppler.mk                             | 2 +-
> >  package/wampcc/wampcc.mk                               | 2 +-
> >  6 files changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/package/cutelyst/cutelyst.mk b/package/cutelyst/cutelyst.mk
> > index 9520922454..5313b003ad 100644
> > --- a/package/cutelyst/cutelyst.mk
> > +++ b/package/cutelyst/cutelyst.mk
> > @@ -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)
> > diff --git a/package/gerbera/gerbera.mk b/package/gerbera/gerbera.mk
> > index ccb3b2eeb5..f75595a46d 100644
> > --- a/package/gerbera/gerbera.mk
> > +++ b/package/gerbera/gerbera.mk
> > @@ -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)
> > diff --git a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> > index 2a782b35e1..81617492c0 100644
> > --- a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> > +++ b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> > @@ -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))
> > diff --git a/package/kodi/kodi.mk b/package/kodi/kodi.mk
> > index 6edb0b7fca..28fe4a6a92 100644
> > --- a/package/kodi/kodi.mk
> > +++ b/package/kodi/kodi.mk
> > @@ -184,7 +184,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),)
> > diff --git a/package/poppler/poppler.mk b/package/poppler/poppler.mk
> > index 44ad04bf7c..a5a97d974b 100644
> > --- a/package/poppler/poppler.mk
> > +++ b/package/poppler/poppler.mk
> > @@ -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)
> > diff --git a/package/wampcc/wampcc.mk b/package/wampcc/wampcc.mk
> > index 5e7ee03651..11bb1f90b5 100644
> > --- a/package/wampcc/wampcc.mk
> > +++ b/package/wampcc/wampcc.mk
> > @@ -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))
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210415/2397cab2/attachment.html>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-04-15  3:49     ` Gleb Mazovetskiy
@ 2021-04-15 19:44       ` Peter Seiderer
  2021-04-15 20:46         ` Arnout Vandecappelle
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Seiderer @ 2021-04-15 19:44 UTC (permalink / raw)
  To: buildroot

Hello Gleb,

On Thu, 15 Apr 2021 04:49:29 +0100, Gleb Mazovetskiy <glex.spb@gmail.com> wrote:

> Hi Peter,
>
> The failing defconfig is here (it's specific to this buildroot):
> https://github.com/batocera-linux/batocera.linux/blob/8d8038a6ddaae03f0150fd28a2d23c371156ebf2/configs/batocera-odroidgoa_defconfig

Thanks for providing the defconfig, as far as I can see nothing special (and no
poppler enabled?), normal buildroot-glibc-gcc-10.x toolchain..., and I am not
able to reproduce your problem (did only test without ccache)...

>
> Here is the compiler command without this change:
>
> /usr/bin/ccache
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/bin/aarch64-buildroot-linux-gnu-g++
> --sysroot=/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot
> -Dpoppler_EXPORTS
> -I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0
> -I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/fofi
> -I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/goo
> -I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/poppler
> *-isystem
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include*
> -isystem
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/freetype2
> -isystem
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/nss
> -isystem
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/nspr
> -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wcast-align
> -Wformat-security -Wframe-larger-than=65536 -Wlogical-op
> -Wmissing-format-attribute -Wnon-virtual-dtor -Woverloaded-virtual
> -Wmissing-declarations -Wundef -Wzero-as-null-pointer-constant -Wshadow
> -Wsuggest-override -fno-exceptions -fno-check-new -fno-common
> -D_DEFAULT_SOURCE -O2 -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64 * -O3   -latomic -fPIC *-pthread -std=c++14 -MD -MT
> CMakeFiles/poppler.dir/goo/gbase64.cc.o -MF
> CMakeFiles/poppler.dir/goo/gbase64.cc.o.d -o
> CMakeFiles/poppler.dir/goo/gbase64.cc.o -c
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/goo/gbase64.cc
>
> With this change:
>
> /usr/bin/ccache
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/bin/aarch64-buildroot-linux-gnu-g++
> --sysroot=/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot
> -Dpoppler_EXPORTS
> -I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0
> -I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/fofi
> -I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/goo
> -I/home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/poppler
> -isystem
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/freetype2
> -isystem
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/nss
> -isystem
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/nspr
> -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wcast-align
> -Wformat-security -Wframe-larger-than=65536 -Wlogical-op
> -Wmissing-format-attribute -Wnon-virtual-dtor -Woverloaded-virtual
> -Wmissing-declarations -Wundef -Wzero-as-null-pointer-constant -Wshadow
> -Wsuggest-override -fno-exceptions -fno-check-new -fno-common
> -D_DEFAULT_SOURCE -O2 -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64 *-O3 -fPIC* -pthread -std=c++14 -MD -MT
> CMakeFiles/poppler.dir/goo/gbase64.cc.o -MF
> CMakeFiles/poppler.dir/goo/gbase64.cc.o.d -o
> CMakeFiles/poppler.dir/goo/gbase64.cc.o -c
> /home/gleb/repos/glebm/batocera.linux/output/batocera-odroidgoa/build/poppler-0.84.0/goo/gbase64.cc
>
> Notice that the first command has an extra include statement

Here no unexpected difference in compile flags, only the expected -latomic
difference (and both times only one -isystem for freetype2)....

Still +1 for the patch (as the CMAKE_EXE_LINKER_FLAGS usage is smarter than
the '$(TARGET_CXXFLAGS) -latomic' dance...., but can not follow your
reasoning/commit log...

Regards,
Peter

>
> On Wed, Apr 14, 2021 at 6:49 PM Peter Seiderer <ps.report@gmx.net> wrote:
>
> > Hello Gleb,
> >
> > On Tue, 13 Apr 2021 07:26:14 +0100, Gleb Mazovetskiy <glex.spb@gmail.com>
> > wrote:
> >
> > > 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.
> >
> > Out of interest (as this is a compile not link failure), what is the actual
> > change in the compile parameter set?
> >
> > Can you provide a (failing) defconfig?
> >
> > Regards,
> > Peter
> >
> > >
> > > ---
> > > Changes v1 -> v2
> > >   - Also fix kodi
> > > ---
> > >  package/cutelyst/cutelyst.mk                           | 2 +-
> > >  package/gerbera/gerbera.mk                             | 2 +-
> > >  package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk | 2 +-
> > >  package/kodi/kodi.mk                                   | 2 +-
> > >  package/poppler/poppler.mk                             | 2 +-
> > >  package/wampcc/wampcc.mk                               | 2 +-
> > >  6 files changed, 6 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/package/cutelyst/cutelyst.mk b/package/cutelyst/cutelyst.mk
> > > index 9520922454..5313b003ad 100644
> > > --- a/package/cutelyst/cutelyst.mk
> > > +++ b/package/cutelyst/cutelyst.mk
> > > @@ -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)
> > > diff --git a/package/gerbera/gerbera.mk b/package/gerbera/gerbera.mk
> > > index ccb3b2eeb5..f75595a46d 100644
> > > --- a/package/gerbera/gerbera.mk
> > > +++ b/package/gerbera/gerbera.mk
> > > @@ -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)
> > > diff --git a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> > b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> > > index 2a782b35e1..81617492c0 100644
> > > --- a/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> > > +++ b/package/kf5/kf5-modemmanager-qt/kf5-modemmanager-qt.mk
> > > @@ -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))
> > > diff --git a/package/kodi/kodi.mk b/package/kodi/kodi.mk
> > > index 6edb0b7fca..28fe4a6a92 100644
> > > --- a/package/kodi/kodi.mk
> > > +++ b/package/kodi/kodi.mk
> > > @@ -184,7 +184,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),)
> > > diff --git a/package/poppler/poppler.mk b/package/poppler/poppler.mk
> > > index 44ad04bf7c..a5a97d974b 100644
> > > --- a/package/poppler/poppler.mk
> > > +++ b/package/poppler/poppler.mk
> > > @@ -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)
> > > diff --git a/package/wampcc/wampcc.mk b/package/wampcc/wampcc.mk
> > > index 5e7ee03651..11bb1f90b5 100644
> > > --- a/package/wampcc/wampcc.mk
> > > +++ b/package/wampcc/wampcc.mk
> > > @@ -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))
> >
> >

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-04-15 19:44       ` Peter Seiderer
@ 2021-04-15 20:46         ` Arnout Vandecappelle
  2021-04-15 21:00           ` Gleb Mazovetskiy
  0 siblings, 1 reply; 11+ messages in thread
From: Arnout Vandecappelle @ 2021-04-15 20:46 UTC (permalink / raw)
  To: buildroot



On 15/04/2021 21:44, Peter Seiderer wrote:
> Hello Gleb,
> 
> On Thu, 15 Apr 2021 04:49:29 +0100, Gleb Mazovetskiy <glex.spb@gmail.com> wrote:
> 
>> Hi Peter,
>>
>> The failing defconfig is here (it's specific to this buildroot):
>> https://github.com/batocera-linux/batocera.linux/blob/8d8038a6ddaae03f0150fd28a2d23c371156ebf2/configs/batocera-odroidgoa_defconfig
> 
> Thanks for providing the defconfig, as far as I can see nothing special (and no
> poppler enabled?), normal buildroot-glibc-gcc-10.x toolchain..., and I am not
> able to reproduce your problem (did only test without ccache)...

 CMake is known to do weird things with -isystem, and this can change over cmake
versions, and we use the host cmake if sufficiently recent. So that could make a
difference.

 Regards,
 Arnout

[snip]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-04-15 20:46         ` Arnout Vandecappelle
@ 2021-04-15 21:00           ` Gleb Mazovetskiy
  2021-04-15 21:02             ` Gleb Mazovetskiy
  0 siblings, 1 reply; 11+ messages in thread
From: Gleb Mazovetskiy @ 2021-04-15 21:00 UTC (permalink / raw)
  To: buildroot

My host cmake is 3.20.0 from Ubuntu 20.10
It must be some environment / host cmake difference but I can't pinpoint it
either, thus my vague commit message

If I run this in a Docker container with an older Ubuntu I can't reproduce
it either

On Thu, Apr 15, 2021 at 9:46 PM Arnout Vandecappelle <arnout@mind.be> wrote:

>
>
> On 15/04/2021 21:44, Peter Seiderer wrote:
> > Hello Gleb,
> >
> > On Thu, 15 Apr 2021 04:49:29 +0100, Gleb Mazovetskiy <glex.spb@gmail.com>
> wrote:
> >
> >> Hi Peter,
> >>
> >> The failing defconfig is here (it's specific to this buildroot):
> >>
> https://github.com/batocera-linux/batocera.linux/blob/8d8038a6ddaae03f0150fd28a2d23c371156ebf2/configs/batocera-odroidgoa_defconfig
> >
> > Thanks for providing the defconfig, as far as I can see nothing special
> (and no
> > poppler enabled?), normal buildroot-glibc-gcc-10.x toolchain..., and I
> am not
> > able to reproduce your problem (did only test without ccache)...
>
>  CMake is known to do weird things with -isystem, and this can change over
> cmake
> versions, and we use the host cmake if sufficiently recent. So that could
> make a
> difference.
>
>  Regards,
>  Arnout
>
> [snip]
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210415/b426bc77/attachment.html>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-04-15 21:00           ` Gleb Mazovetskiy
@ 2021-04-15 21:02             ` Gleb Mazovetskiy
  2021-04-16 22:36               ` Gleb Mazovetskiy
  0 siblings, 1 reply; 11+ messages in thread
From: Gleb Mazovetskiy @ 2021-04-15 21:02 UTC (permalink / raw)
  To: buildroot

> Thanks for providing the defconfig, as far as I can see nothing special
(and no poppler enabled?),

Poppler is a transitive dependency of another package (
https://github.com/batocera-linux/batocera.linux/blob/95f96803e04027b7996c73ae05b40a891dad0ca9/package/batocera/emulationstation/batocera-emulationstation/Config.in
)

On Thu, Apr 15, 2021 at 10:00 PM Gleb Mazovetskiy <glex.spb@gmail.com>
wrote:

> My host cmake is 3.20.0 from Ubuntu 20.10
> It must be some environment / host cmake difference but I can't pinpoint
> it either, thus my vague commit message
>
> If I run this in a Docker container with an older Ubuntu I can't reproduce
> it either
>
> On Thu, Apr 15, 2021 at 9:46 PM Arnout Vandecappelle <arnout@mind.be>
> wrote:
>
>>
>>
>> On 15/04/2021 21:44, Peter Seiderer wrote:
>> > Hello Gleb,
>> >
>> > On Thu, 15 Apr 2021 04:49:29 +0100, Gleb Mazovetskiy <
>> glex.spb at gmail.com> wrote:
>> >
>> >> Hi Peter,
>> >>
>> >> The failing defconfig is here (it's specific to this buildroot):
>> >>
>> https://github.com/batocera-linux/batocera.linux/blob/8d8038a6ddaae03f0150fd28a2d23c371156ebf2/configs/batocera-odroidgoa_defconfig
>> >
>> > Thanks for providing the defconfig, as far as I can see nothing special
>> (and no
>> > poppler enabled?), normal buildroot-glibc-gcc-10.x toolchain..., and I
>> am not
>> > able to reproduce your problem (did only test without ccache)...
>>
>>  CMake is known to do weird things with -isystem, and this can change
>> over cmake
>> versions, and we use the host cmake if sufficiently recent. So that could
>> make a
>> difference.
>>
>>  Regards,
>>  Arnout
>>
>> [snip]
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210415/8ccb86e7/attachment.html>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-04-15 21:02             ` Gleb Mazovetskiy
@ 2021-04-16 22:36               ` Gleb Mazovetskiy
  0 siblings, 0 replies; 11+ messages in thread
From: Gleb Mazovetskiy @ 2021-04-16 22:36 UTC (permalink / raw)
  To: buildroot

Can the maintainers please merge this?

It's still a better way to do this, quoting Peter Seiderer:

> Still +1 for the patch (as the CMAKE_EXE_LINKER_FLAGS usage is smarter
than the '$(TARGET_CXXFLAGS) -latomic' dance....

On Thu, Apr 15, 2021 at 10:02 PM Gleb Mazovetskiy <glex.spb@gmail.com>
wrote:

> > Thanks for providing the defconfig, as far as I can see nothing special
> (and no poppler enabled?),
>
> Poppler is a transitive dependency of another package (
> https://github.com/batocera-linux/batocera.linux/blob/95f96803e04027b7996c73ae05b40a891dad0ca9/package/batocera/emulationstation/batocera-emulationstation/Config.in
> )
>
> On Thu, Apr 15, 2021 at 10:00 PM Gleb Mazovetskiy <glex.spb@gmail.com>
> wrote:
>
>> My host cmake is 3.20.0 from Ubuntu 20.10
>> It must be some environment / host cmake difference but I can't pinpoint
>> it either, thus my vague commit message
>>
>> If I run this in a Docker container with an older Ubuntu I can't
>> reproduce it either
>>
>> On Thu, Apr 15, 2021 at 9:46 PM Arnout Vandecappelle <arnout@mind.be>
>> wrote:
>>
>>>
>>>
>>> On 15/04/2021 21:44, Peter Seiderer wrote:
>>> > Hello Gleb,
>>> >
>>> > On Thu, 15 Apr 2021 04:49:29 +0100, Gleb Mazovetskiy <
>>> glex.spb at gmail.com> wrote:
>>> >
>>> >> Hi Peter,
>>> >>
>>> >> The failing defconfig is here (it's specific to this buildroot):
>>> >>
>>> https://github.com/batocera-linux/batocera.linux/blob/8d8038a6ddaae03f0150fd28a2d23c371156ebf2/configs/batocera-odroidgoa_defconfig
>>> >
>>> > Thanks for providing the defconfig, as far as I can see nothing
>>> special (and no
>>> > poppler enabled?), normal buildroot-glibc-gcc-10.x toolchain..., and I
>>> am not
>>> > able to reproduce your problem (did only test without ccache)...
>>>
>>>  CMake is known to do weird things with -isystem, and this can change
>>> over cmake
>>> versions, and we use the host cmake if sufficiently recent. So that
>>> could make a
>>> difference.
>>>
>>>  Regards,
>>>  Arnout
>>>
>>> [snip]
>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210416/330f607f/attachment.html>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-04-13  6:26 ` [Buildroot] [PATCH v2 " Gleb Mazovetskiy
  2021-04-14 17:49   ` Peter Seiderer
@ 2021-05-01 13:02   ` Arnout Vandecappelle
  2021-05-07  7:28     ` Peter Korsgaard
  1 sibling, 1 reply; 11+ messages in thread
From: Arnout Vandecappelle @ 2021-05-01 13:02 UTC (permalink / raw)
  To: buildroot



On 13/04/2021 08:26, Gleb Mazovetskiy wrote:
> 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.

 Applied to master, thanks.

 Your SoB was missing here, but it was on v1 so I re-added it.

 Normally we expect to have one patch per package. This makes it easier to:
- port to the stable branch (only the packages that apply to the stable branch);
- partially revert.

 In this case, I couldn't be bothered to change it though. Just for the future,
know that that's the preferred way. It also helps increase your ranking in the
contribution statistics :-)

 There are a few other packages that do something similar: bctoolbox with
-liconv, kf5-kcoreaddons with -latomic, libcpprestsdk with -latomic, mariadb
with -latomic, ogre with -latomic, opencv3 with -latomic. Could you change (and
test) those ones as well?

[snip]
> diff --git a/package/kodi/kodi.mk b/package/kodi/kodi.mk
> index 6edb0b7fca..28fe4a6a92 100644
> --- a/package/kodi/kodi.mk
> +++ b/package/kodi/kodi.mk
> @@ -184,7 +184,7 @@ endif
>  
>  # mips: uses __atomic_load_8
>  ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
> -KODI_CXX_FLAGS += -latomic

 KODI_CXX_FLAGS is no longer set after this change, so I removed its use as well.


 Regards,
 Arnout

> +KODI_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
>  endif
>  
>  ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5),)
> diff --git a/package/poppler/poppler.mk b/package/poppler/poppler.mk
> index 44ad04bf7c..a5a97d974b 100644
> --- a/package/poppler/poppler.mk
> +++ b/package/poppler/poppler.mk
> @@ -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)
> diff --git a/package/wampcc/wampcc.mk b/package/wampcc/wampcc.mk
> index 5e7ee03651..11bb1f90b5 100644
> --- a/package/wampcc/wampcc.mk
> +++ b/package/wampcc/wampcc.mk
> @@ -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))
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 1/1] Fix -latomic for CMake packages
  2021-05-01 13:02   ` Arnout Vandecappelle
@ 2021-05-07  7:28     ` Peter Korsgaard
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2021-05-07  7:28 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

 > On 13/04/2021 08:26, Gleb Mazovetskiy wrote:
 >> 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.

 >  Applied to master, thanks.

 >  Your SoB was missing here, but it was on v1 so I re-added it.

 >  Normally we expect to have one patch per package. This makes it easier to:
 > - port to the stable branch (only the packages that apply to the stable branch);
 > - partially revert.

 >  In this case, I couldn't be bothered to change it though. Just for the future,
 > know that that's the preferred way. It also helps increase your ranking in the
 > contribution statistics :-)

 >  There are a few other packages that do something similar: bctoolbox with
 > -liconv, kf5-kcoreaddons with -latomic, libcpprestsdk with -latomic, mariadb
 > with -latomic, ogre with -latomic, opencv3 with -latomic. Could you change (and
 > test) those ones as well?

Committed to 2021.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-05-07  7:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13  6:09 [Buildroot] [PATCH 1/1] Fix -latomic for CMake packages Gleb Mazovetskiy
2021-04-13  6:26 ` [Buildroot] [PATCH v2 " Gleb Mazovetskiy
2021-04-14 17:49   ` Peter Seiderer
2021-04-15  3:49     ` Gleb Mazovetskiy
2021-04-15 19:44       ` Peter Seiderer
2021-04-15 20:46         ` Arnout Vandecappelle
2021-04-15 21:00           ` Gleb Mazovetskiy
2021-04-15 21:02             ` Gleb Mazovetskiy
2021-04-16 22:36               ` Gleb Mazovetskiy
2021-05-01 13:02   ` Arnout Vandecappelle
2021-05-07  7:28     ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.