diff mbox

[OpenWrt-Devel] tools/cmake: fix compile on Alpine Linux

Message ID 1457384882-20820-1-git-send-email-dirkneukirchen@web.de
State Accepted
Headers show

Commit Message

Dirk Neukirchen March 7, 2016, 9:08 p.m. UTC
internal jsoncpp include order leads to multiple build
errors on Alpine Linux which uses musl libc

use include order from upstream jsoncpp

first error was:
In file included from /usr/include/c++/5.3.0/stdexcept:38:0,
                 from /home/..../openwrt/build_dir/host/cmake-3.4.3/Utilities/cmjsoncpp/include/json/assertions.h:16,
                 from /home/..../openwrt/build_dir/host/cmake-3.4.3/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp:7:
/usr/include/c++/5.3.0/exception:35:9: error: '#pragma' is not allowed here
 #pragma GCC visibility push(default)

Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de>
---
 tools/cmake/patches/120-alpine_musl-compat.patch | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 tools/cmake/patches/120-alpine_musl-compat.patch

Comments

John Crispin March 8, 2016, 6:52 a.m. UTC | #1
On 07/03/2016 22:08, Dirk Neukirchen wrote:
> internal jsoncpp include order leads to multiple build
> errors on Alpine Linux which uses musl libc
> 
> use include order from upstream jsoncpp
> 
> first error was:
> In file included from /usr/include/c++/5.3.0/stdexcept:38:0,
>                  from /home/..../openwrt/build_dir/host/cmake-3.4.3/Utilities/cmjsoncpp/include/json/assertions.h:16,
>                  from /home/..../openwrt/build_dir/host/cmake-3.4.3/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp:7:
> /usr/include/c++/5.3.0/exception:35:9: error: '#pragma' is not allowed here
>  #pragma GCC visibility push(default)
> 

Hi,

all musl patches need to be submitted to the musl mailing list first.
maybe you have done so already. if not it would be great if you could do so.

	John

> Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de>
> ---
>  tools/cmake/patches/120-alpine_musl-compat.patch | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>  create mode 100644 tools/cmake/patches/120-alpine_musl-compat.patch
> 
> diff --git a/tools/cmake/patches/120-alpine_musl-compat.patch b/tools/cmake/patches/120-alpine_musl-compat.patch
> new file mode 100644
> index 0000000..ae93201
> --- /dev/null
> +++ b/tools/cmake/patches/120-alpine_musl-compat.patch
> @@ -0,0 +1,17 @@
> +--- a/Utilities/cmjsoncpp/include/json/assertions.h
> ++++ b/Utilities/cmjsoncpp/include/json/assertions.h
> +@@ -6,12 +6,12 @@
> + #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
> + #define CPPTL_JSON_ASSERTIONS_H_INCLUDED
> + 
> ++#include <stdlib.h>
> ++
> + #if !defined(JSON_IS_AMALGAMATION)
> + #include "config.h"
> + #endif // if !defined(JSON_IS_AMALGAMATION)
> + 
> +-#include <stdlib.h>
> +-
> + #if JSON_USE_EXCEPTION
> + #include <stdexcept>
> + #define JSON_ASSERT(condition)                                                 \
>
John Crispin March 9, 2016, 11:06 a.m. UTC | #2
On 08/03/2016 07:52, John Crispin wrote:
> 
> 
> On 07/03/2016 22:08, Dirk Neukirchen wrote:
>> internal jsoncpp include order leads to multiple build
>> errors on Alpine Linux which uses musl libc
>>
>> use include order from upstream jsoncpp
>>
>> first error was:
>> In file included from /usr/include/c++/5.3.0/stdexcept:38:0,
>>                  from /home/..../openwrt/build_dir/host/cmake-3.4.3/Utilities/cmjsoncpp/include/json/assertions.h:16,
>>                  from /home/..../openwrt/build_dir/host/cmake-3.4.3/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp:7:
>> /usr/include/c++/5.3.0/exception:35:9: error: '#pragma' is not allowed here
>>  #pragma GCC visibility push(default)
>>
> 
> Hi,
> 
> all musl patches need to be submitted to the musl mailing list first.
> maybe you have done so already. if not it would be great if you could do so.
> 
> 	John
> 

brainfart, this is not a musl patch but a cmake patch. i'll pick this
one up on the next merge round.

	John

>> Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de>
>> ---
>>  tools/cmake/patches/120-alpine_musl-compat.patch | 17 +++++++++++++++++
>>  1 file changed, 17 insertions(+)
>>  create mode 100644 tools/cmake/patches/120-alpine_musl-compat.patch
>>
>> diff --git a/tools/cmake/patches/120-alpine_musl-compat.patch b/tools/cmake/patches/120-alpine_musl-compat.patch
>> new file mode 100644
>> index 0000000..ae93201
>> --- /dev/null
>> +++ b/tools/cmake/patches/120-alpine_musl-compat.patch
>> @@ -0,0 +1,17 @@
>> +--- a/Utilities/cmjsoncpp/include/json/assertions.h
>> ++++ b/Utilities/cmjsoncpp/include/json/assertions.h
>> +@@ -6,12 +6,12 @@
>> + #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
>> + #define CPPTL_JSON_ASSERTIONS_H_INCLUDED
>> + 
>> ++#include <stdlib.h>
>> ++
>> + #if !defined(JSON_IS_AMALGAMATION)
>> + #include "config.h"
>> + #endif // if !defined(JSON_IS_AMALGAMATION)
>> + 
>> +-#include <stdlib.h>
>> +-
>> + #if JSON_USE_EXCEPTION
>> + #include <stdexcept>
>> + #define JSON_ASSERT(condition)                                                 \
>>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
diff mbox

Patch

diff --git a/tools/cmake/patches/120-alpine_musl-compat.patch b/tools/cmake/patches/120-alpine_musl-compat.patch
new file mode 100644
index 0000000..ae93201
--- /dev/null
+++ b/tools/cmake/patches/120-alpine_musl-compat.patch
@@ -0,0 +1,17 @@ 
+--- a/Utilities/cmjsoncpp/include/json/assertions.h
++++ b/Utilities/cmjsoncpp/include/json/assertions.h
+@@ -6,12 +6,12 @@
+ #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
+ #define CPPTL_JSON_ASSERTIONS_H_INCLUDED
+ 
++#include <stdlib.h>
++
+ #if !defined(JSON_IS_AMALGAMATION)
+ #include "config.h"
+ #endif // if !defined(JSON_IS_AMALGAMATION)
+ 
+-#include <stdlib.h>
+-
+ #if JSON_USE_EXCEPTION
+ #include <stdexcept>
+ #define JSON_ASSERT(condition)                                                 \