jerryscript: fix build with gcc15 (#507813)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c
|
||||
index 280a94c..b147679 100644
|
||||
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c
|
||||
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c
|
||||
@@ -36,12 +36,12 @@
|
||||
/**
|
||||
* Day names
|
||||
*/
|
||||
-const char day_names_p[7][3] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
+const char day_names_p[7][3] __attribute__((nonstring)) = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
|
||||
/**
|
||||
* Month names
|
||||
*/
|
||||
-const char month_names_p[12][3] = {
|
||||
+const char month_names_p[12][3] __attribute__((nonstring)) = {
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
||||
@@ -30,6 +30,16 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-Evu4qLlwg3Sf9w/ojtZMNxGJEtopHgKnwqlpf115zD4=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# https://github.com/jerryscript-project/jerryscript/issues/5263
|
||||
./fix-gcc15.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# get rid of bundled CMake toolchain files
|
||||
rm cmake/toolchain_*
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
@@ -41,6 +51,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
|
||||
];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-literal-range";
|
||||
|
||||
nativeCheckInputs = [
|
||||
python3
|
||||
];
|
||||
@@ -57,8 +69,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
# Uses a custom lib variable that ignores what nixpkgs's cmake setupHook specifies.
|
||||
postInstall = ''
|
||||
mkdir -p "$lib/lib"
|
||||
mv "$out/lib/"*.so "$lib/lib"
|
||||
mkdir $lib
|
||||
mv "$out/lib" "$lib/"
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
@@ -92,6 +104,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"libjerry-ext"
|
||||
"libjerry-port"
|
||||
];
|
||||
maintainers = with lib.maintainers; [ RossSmyth ];
|
||||
maintainers = with lib.maintainers; [
|
||||
RossSmyth
|
||||
wishstudio
|
||||
];
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user