All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/gcc: Fix compiling jsoncpp with musl
@ 2015-04-11  7:59 Bernd Kuhls
  2015-04-11  7:59 ` [Buildroot] [PATCH 2/2] package/jsoncpp: bump version to 1.6.1 Bernd Kuhls
  2015-04-11 10:43 ` [Buildroot] [PATCH 1/2] package/gcc: Fix compiling jsoncpp with musl Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Bernd Kuhls @ 2015-04-11  7:59 UTC (permalink / raw)
  To: buildroot

[ 16%] Building CXX object src/lib_json/CMakeFiles/jsoncpp_lib.dir/json_value.cpp.o
In file included from /home/fli4l/br3/output/host/usr/lib/gcc/x86_64-buildroot-linux-musl/4.9.2/include/xmmintrin.h:34:0,
                 from /home/fli4l/br3/output/host/usr/lib/gcc/x86_64-buildroot-linux-musl/4.9.2/include/x86intrin.h:31,
                 from /home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/include/c++/4.9.2/x86_64-buildroot-linux-musl/bits/opt_random.h:33,
                 from /home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/include/c++/4.9.2/random:50,
                 from /home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/include/c++/4.9.2/bits/stl_algo.h:66,
                 from /home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/include/c++/4.9.2/algorithm:62,
                 from /home/fli4l/br3/output/build/jsoncpp-1.6.1/src/lib_json/json_value.cpp:20:
/home/fli4l/br3/output/host/usr/lib/gcc/x86_64-buildroot-linux-musl/4.9.2/include/mm_malloc.h:34:64: error: declaration of 'int posix_memalign(void**, size_t, size_t) throw ()' has a different exception specifier
 extern "C" int posix_memalign (void **, size_t, size_t) throw ();
                                                                ^
In file included from /home/fli4l/br3/output/build/jsoncpp-1.6.1/include/json/assertions.h:9:0,
                 from /home/fli4l/br3/output/build/jsoncpp-1.6.1/src/lib_json/json_value.cpp:7:
/home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/stdlib.h:98:5: error: from previous declaration 'int posix_memalign(void**, size_t, size_t)'
 int posix_memalign (void **, size_t, size_t);
     ^
make[2]: *** [src/lib_json/CMakeFiles/jsoncpp_lib.dir/json_value.cpp.o] Error 1

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 .../gcc/4.7.4/901-musl-posix_memalign-c++.patch    |   32 ++++++++++++++++++++
 .../gcc/4.8.4/901-musl-posix_memalign-c++.patch    |   32 ++++++++++++++++++++
 .../gcc/4.9.2/901-musl-posix_memalign-c++.patch    |   32 ++++++++++++++++++++
 3 files changed, 96 insertions(+)
 create mode 100644 package/gcc/4.7.4/901-musl-posix_memalign-c++.patch
 create mode 100644 package/gcc/4.8.4/901-musl-posix_memalign-c++.patch
 create mode 100644 package/gcc/4.9.2/901-musl-posix_memalign-c++.patch

diff --git a/package/gcc/4.7.4/901-musl-posix_memalign-c++.patch b/package/gcc/4.7.4/901-musl-posix_memalign-c++.patch
new file mode 100644
index 0000000..4869eb8
--- /dev/null
+++ b/package/gcc/4.7.4/901-musl-posix_memalign-c++.patch
@@ -0,0 +1,32 @@
+Downloaded from
+http://git.alpinelinux.org/cgit/aports/tree/main/gcc/musl-posix_memalign-c++.patch
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+Fix conflicting prototype of posix_memalign for c++
+http://www.openwall.com/lists/musl/2013/11/10/1
+
+--- ./gcc/config/i386/pmm_malloc.h.orig
++++ ./gcc/config/i386/pmm_malloc.h
+@@ -28,11 +28,7 @@
+ 
+ /* We can't depend on <stdlib.h> since the prototype of posix_memalign
+    may not be visible.  */
+-#ifndef __cplusplus
+-extern int posix_memalign (void **, size_t, size_t);
+-#else
+-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+-#endif
++extern int __gcc_posix_memalign (void **, size_t, size_t) __asm__("posix_memalign");
+ 
+ static __inline void *
+ _mm_malloc (size_t size, size_t alignment)
+@@ -42,7 +38,7 @@
+     return malloc (size);
+   if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
+     alignment = sizeof (void *);
+-  if (posix_memalign (&ptr, alignment, size) == 0)
++  if (__gcc_posix_memalign (&ptr, alignment, size) == 0)
+     return ptr;
+   else
+     return NULL;
diff --git a/package/gcc/4.8.4/901-musl-posix_memalign-c++.patch b/package/gcc/4.8.4/901-musl-posix_memalign-c++.patch
new file mode 100644
index 0000000..4869eb8
--- /dev/null
+++ b/package/gcc/4.8.4/901-musl-posix_memalign-c++.patch
@@ -0,0 +1,32 @@
+Downloaded from
+http://git.alpinelinux.org/cgit/aports/tree/main/gcc/musl-posix_memalign-c++.patch
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+Fix conflicting prototype of posix_memalign for c++
+http://www.openwall.com/lists/musl/2013/11/10/1
+
+--- ./gcc/config/i386/pmm_malloc.h.orig
++++ ./gcc/config/i386/pmm_malloc.h
+@@ -28,11 +28,7 @@
+ 
+ /* We can't depend on <stdlib.h> since the prototype of posix_memalign
+    may not be visible.  */
+-#ifndef __cplusplus
+-extern int posix_memalign (void **, size_t, size_t);
+-#else
+-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+-#endif
++extern int __gcc_posix_memalign (void **, size_t, size_t) __asm__("posix_memalign");
+ 
+ static __inline void *
+ _mm_malloc (size_t size, size_t alignment)
+@@ -42,7 +38,7 @@
+     return malloc (size);
+   if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
+     alignment = sizeof (void *);
+-  if (posix_memalign (&ptr, alignment, size) == 0)
++  if (__gcc_posix_memalign (&ptr, alignment, size) == 0)
+     return ptr;
+   else
+     return NULL;
diff --git a/package/gcc/4.9.2/901-musl-posix_memalign-c++.patch b/package/gcc/4.9.2/901-musl-posix_memalign-c++.patch
new file mode 100644
index 0000000..4869eb8
--- /dev/null
+++ b/package/gcc/4.9.2/901-musl-posix_memalign-c++.patch
@@ -0,0 +1,32 @@
+Downloaded from
+http://git.alpinelinux.org/cgit/aports/tree/main/gcc/musl-posix_memalign-c++.patch
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+Fix conflicting prototype of posix_memalign for c++
+http://www.openwall.com/lists/musl/2013/11/10/1
+
+--- ./gcc/config/i386/pmm_malloc.h.orig
++++ ./gcc/config/i386/pmm_malloc.h
+@@ -28,11 +28,7 @@
+ 
+ /* We can't depend on <stdlib.h> since the prototype of posix_memalign
+    may not be visible.  */
+-#ifndef __cplusplus
+-extern int posix_memalign (void **, size_t, size_t);
+-#else
+-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+-#endif
++extern int __gcc_posix_memalign (void **, size_t, size_t) __asm__("posix_memalign");
+ 
+ static __inline void *
+ _mm_malloc (size_t size, size_t alignment)
+@@ -42,7 +38,7 @@
+     return malloc (size);
+   if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
+     alignment = sizeof (void *);
+-  if (posix_memalign (&ptr, alignment, size) == 0)
++  if (__gcc_posix_memalign (&ptr, alignment, size) == 0)
+     return ptr;
+   else
+     return NULL;
-- 
1.7.10.4

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

* [Buildroot] [PATCH 2/2] package/jsoncpp: bump version to 1.6.1
  2015-04-11  7:59 [Buildroot] [PATCH 1/2] package/gcc: Fix compiling jsoncpp with musl Bernd Kuhls
@ 2015-04-11  7:59 ` Bernd Kuhls
  2015-04-11 10:43 ` [Buildroot] [PATCH 1/2] package/gcc: Fix compiling jsoncpp with musl Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Bernd Kuhls @ 2015-04-11  7:59 UTC (permalink / raw)
  To: buildroot


Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/jsoncpp/0001-Revert-Use-std-namespace-for-snprintf.patch |    2 +-
 package/jsoncpp/jsoncpp.mk                                       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/jsoncpp/0001-Revert-Use-std-namespace-for-snprintf.patch b/package/jsoncpp/0001-Revert-Use-std-namespace-for-snprintf.patch
index 6c6ae2d..7935849 100644
--- a/package/jsoncpp/0001-Revert-Use-std-namespace-for-snprintf.patch
+++ b/package/jsoncpp/0001-Revert-Use-std-namespace-for-snprintf.patch
@@ -29,7 +29,7 @@ index 83102fd2bb86..f7ad1e21bbc0 100644
  
  #if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below
  #define snprintf _snprintf
--#else
+-#elif __cplusplus >= 201103L
 -#define snprintf std::snprintf
  #endif
  
diff --git a/package/jsoncpp/jsoncpp.mk b/package/jsoncpp/jsoncpp.mk
index 3044be1..63b18e6 100644
--- a/package/jsoncpp/jsoncpp.mk
+++ b/package/jsoncpp/jsoncpp.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-JSONCPP_VERSION = 1.6.0
+JSONCPP_VERSION = 1.6.1
 JSONCPP_SITE = $(call github,open-source-parsers,jsoncpp,$(JSONCPP_VERSION))
 JSONCPP_LICENSE = Public Domain or MIT
 JSONCPP_LICENSE_FILES = LICENSE
-- 
1.7.10.4

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

* [Buildroot] [PATCH 1/2] package/gcc: Fix compiling jsoncpp with musl
  2015-04-11  7:59 [Buildroot] [PATCH 1/2] package/gcc: Fix compiling jsoncpp with musl Bernd Kuhls
  2015-04-11  7:59 ` [Buildroot] [PATCH 2/2] package/jsoncpp: bump version to 1.6.1 Bernd Kuhls
@ 2015-04-11 10:43 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2015-04-11 10:43 UTC (permalink / raw)
  To: buildroot

Dear Bernd Kuhls,

On Sat, 11 Apr 2015 09:59:22 +0200, Bernd Kuhls wrote:
> [ 16%] Building CXX object src/lib_json/CMakeFiles/jsoncpp_lib.dir/json_value.cpp.o
> In file included from /home/fli4l/br3/output/host/usr/lib/gcc/x86_64-buildroot-linux-musl/4.9.2/include/xmmintrin.h:34:0,
>                  from /home/fli4l/br3/output/host/usr/lib/gcc/x86_64-buildroot-linux-musl/4.9.2/include/x86intrin.h:31,
>                  from /home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/include/c++/4.9.2/x86_64-buildroot-linux-musl/bits/opt_random.h:33,
>                  from /home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/include/c++/4.9.2/random:50,
>                  from /home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/include/c++/4.9.2/bits/stl_algo.h:66,
>                  from /home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/include/c++/4.9.2/algorithm:62,
>                  from /home/fli4l/br3/output/build/jsoncpp-1.6.1/src/lib_json/json_value.cpp:20:
> /home/fli4l/br3/output/host/usr/lib/gcc/x86_64-buildroot-linux-musl/4.9.2/include/mm_malloc.h:34:64: error: declaration of 'int posix_memalign(void**, size_t, size_t) throw ()' has a different exception specifier
>  extern "C" int posix_memalign (void **, size_t, size_t) throw ();
>                                                                 ^
> In file included from /home/fli4l/br3/output/build/jsoncpp-1.6.1/include/json/assertions.h:9:0,
>                  from /home/fli4l/br3/output/build/jsoncpp-1.6.1/src/lib_json/json_value.cpp:7:
> /home/fli4l/br3/output/host/usr/x86_64-buildroot-linux-musl/sysroot/usr/include/stdlib.h:98:5: error: from previous declaration 'int posix_memalign(void**, size_t, size_t)'
>  int posix_memalign (void **, size_t, size_t);
>      ^
> make[2]: *** [src/lib_json/CMakeFiles/jsoncpp_lib.dir/json_value.cpp.o] Error 1
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

I think instead just make jsoncpp depends on !musl. Because while this
patch fixes the problem for the internal toolchain backend, it will
continue to fail with external musl toolchains.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2015-04-11 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-11  7:59 [Buildroot] [PATCH 1/2] package/gcc: Fix compiling jsoncpp with musl Bernd Kuhls
2015-04-11  7:59 ` [Buildroot] [PATCH 2/2] package/jsoncpp: bump version to 1.6.1 Bernd Kuhls
2015-04-11 10:43 ` [Buildroot] [PATCH 1/2] package/gcc: Fix compiling jsoncpp with musl Thomas Petazzoni

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.