Skip to content

Commit 91bb6a1

Browse files
authored
Fix build errors in MacOS, and with GCC 15.2 (#22)
This PR provides some maintenance fixes for the follow issues: - Patch CMake minimum version < 3.10: CI build is failing on MacOS - Fix missing IMPORT_FSTR data building with GCC 15.2 - `day_names_p` and `month_names_p` ill-defined
1 parent f355d30 commit 91bb6a1

8 files changed

Lines changed: 126 additions & 12 deletions

File tree

emscripten-snapshot-compiler/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515

16-
cmake_minimum_required (VERSION 2.8.12)
16+
cmake_minimum_required (VERSION 3.10)
1717
# The name of the files will be jsc.js and jsc.wasm.
1818
# jsc stands for Jerryscript Snapshot Compiler
1919
set(EMSCRIPTEN_SNAPSHOT_COMPILER jsc)

jerryscript.patch

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,115 @@ index 12770f36..5ab67df2 100644
220220

221221
utf8_string1_p = ecma_compare_get_string_chars (string1_p, string1_size_and_length);
222222
utf8_string2_p = ecma_compare_get_string_chars (string2_p, string2_size_and_length);
223+
diff --git a/CMakeLists.txt b/CMakeLists.txt
224+
index 044a2de8..c7887d10 100644
225+
--- a/CMakeLists.txt
226+
+++ b/CMakeLists.txt
227+
@@ -12,7 +12,7 @@
228+
# See the License for the specific language governing permissions and
229+
# limitations under the License.
230+
231+
-cmake_minimum_required (VERSION 2.8.12)
232+
+cmake_minimum_required (VERSION 3.10)
233+
project (Jerry C)
234+
235+
if(NOT DEFINED PYTHON)
236+
diff --git a/jerry-core/CMakeLists.txt b/jerry-core/CMakeLists.txt
237+
index cdcb0f49..48605a2c 100644
238+
--- a/jerry-core/CMakeLists.txt
239+
+++ b/jerry-core/CMakeLists.txt
240+
@@ -12,7 +12,7 @@
241+
# See the License for the specific language governing permissions and
242+
# limitations under the License.
243+
244+
-cmake_minimum_required (VERSION 2.8.12)
245+
+cmake_minimum_required (VERSION 3.10)
246+
set(JERRY_CORE_NAME jerry-core)
247+
project (${JERRY_CORE_NAME} C)
248+
249+
diff --git a/jerry-ext/CMakeLists.txt b/jerry-ext/CMakeLists.txt
250+
index e83b8147..6eef1779 100644
251+
--- a/jerry-ext/CMakeLists.txt
252+
+++ b/jerry-ext/CMakeLists.txt
253+
@@ -12,7 +12,7 @@
254+
# See the License for the specific language governing permissions and
255+
# limitations under the License.
256+
257+
-cmake_minimum_required (VERSION 2.8.12)
258+
+cmake_minimum_required (VERSION 3.10)
259+
set(JERRY_EXT_NAME jerry-ext)
260+
project (${JERRY_EXT_NAME} C)
261+
262+
diff --git a/jerry-main/CMakeLists.txt b/jerry-main/CMakeLists.txt
263+
index ccd62f4e..ff3dc80e 100644
264+
--- a/jerry-main/CMakeLists.txt
265+
+++ b/jerry-main/CMakeLists.txt
266+
@@ -12,7 +12,7 @@
267+
# See the License for the specific language governing permissions and
268+
# limitations under the License.
269+
270+
-cmake_minimum_required (VERSION 2.8.12)
271+
+cmake_minimum_required (VERSION 3.10)
272+
project (jerry-main C)
273+
274+
# Optional build settings
275+
diff --git a/jerry-math/CMakeLists.txt b/jerry-math/CMakeLists.txt
276+
index 4b5bba49..30177e9c 100644
277+
--- a/jerry-math/CMakeLists.txt
278+
+++ b/jerry-math/CMakeLists.txt
279+
@@ -12,7 +12,7 @@
280+
# See the License for the specific language governing permissions and
281+
# limitations under the License.
282+
283+
-cmake_minimum_required (VERSION 2.8.12)
284+
+cmake_minimum_required (VERSION 3.10)
285+
set(JERRY_MATH_NAME jerry-math)
286+
project (${JERRY_MATH_NAME} C)
287+
288+
diff --git a/jerry-port/default/CMakeLists.txt b/jerry-port/default/CMakeLists.txt
289+
index 17f3d478..7ac841e5 100644
290+
--- a/jerry-port/default/CMakeLists.txt
291+
+++ b/jerry-port/default/CMakeLists.txt
292+
@@ -12,7 +12,7 @@
293+
# See the License for the specific language governing permissions and
294+
# limitations under the License.
295+
296+
-cmake_minimum_required (VERSION 2.8.12)
297+
+cmake_minimum_required (VERSION 3.10)
298+
set(JERRY_PORT_DEFAULT_NAME jerry-port-default)
299+
project (${JERRY_PORT_DEFAULT_NAME} C)
300+
301+
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h
302+
index db90bc93..8810bf0c 100644
303+
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h
304+
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h
305+
@@ -175,8 +175,8 @@ typedef enum
306+
} ecma_date_timezone_t;
307+
308+
/* ecma-builtin-helpers-date.c */
309+
-extern const char day_names_p[7][3];
310+
-extern const char month_names_p[12][3];
311+
+extern const char day_names_p[7][4];
312+
+extern const char month_names_p[12][4];
313+
314+
int32_t ecma_date_day_from_time (ecma_number_t time);
315+
int32_t ecma_date_year_from_time (ecma_number_t time);
316+
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c
317+
index 280a94c4..fd5233b5 100644
318+
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c
319+
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers-date.c
320+
@@ -36,12 +36,12 @@
321+
/**
322+
* Day names
323+
*/
324+
-const char day_names_p[7][3] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
325+
+const char day_names_p[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
326+
327+
/**
328+
* Month names
329+
*/
330+
-const char month_names_p[12][3] = {
331+
+const char month_names_p[12][4] = {
332+
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
333+
};
334+

samples/Basic_Context/app/application.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include <SmingCore.h>
22
#include <Jerryscript.h>
33

4+
IMPORT_FSTR_LOCAL(main_snap, PROJECT_DIR "/out/jerryscript/main.js.snap")
5+
46
namespace
57
{
68
/*
@@ -62,7 +64,6 @@ class MyContext : public JS::ContextTemplate<MyContext>
6264

6365
JS::ContextList<MyContext> contexts;
6466
SimpleTimer timer;
65-
IMPORT_FSTR(main_snap, PROJECT_DIR "/out/jerryscript/main.js.snap")
6667

6768
/*
6869
* Called at startup to initialise our jerryscript engine,

samples/Basic_Jsvm/app/application.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#include <SmingCore.h>
22
#include <Jerryscript.h>
33

4+
IMPORT_FSTR_LOCAL(main_snap, PROJECT_DIR "/out/jerryscript/main.js.snap")
5+
46
namespace
57
{
68
JS::Task task;
79

8-
IMPORT_FSTR(main_snap, PROJECT_DIR "/out/jerryscript/main.js.snap")
9-
1010
void startJsvm()
1111
{
1212
JS::initialise();

samples/Event_Jsvm/app/application.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#include <SmingCore.h>
22
#include <Jerryscript.h>
33

4+
IMPORT_FSTR_LOCAL(main_snap, PROJECT_DIR "/out/jerryscript/main.js.snap")
5+
46
namespace
57
{
68
SimpleTimer timer;
79
HashMap<String, JS::Callable::List> events;
810

9-
IMPORT_FSTR(main_snap, PROJECT_DIR "/out/jerryscript/main.js.snap")
10-
1111
/**
1212
* @brief Function to register event listeners
1313
*

test/modules/context.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include <JerryTest.h>
22

3+
IMPORT_FSTR_LOCAL(contextSnap, PROJECT_DIR "/out/jerryscript/context.js.snap")
4+
35
namespace
46
{
5-
IMPORT_FSTR(contextSnap, PROJECT_DIR "/out/jerryscript/context.js.snap")
6-
77
class Context : public JS::ContextTemplate<Context>
88
{
99
public:

test/modules/event.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#include <JerryTest.h>
22

3+
IMPORT_FSTR_LOCAL(eventSnap, PROJECT_DIR "/out/jerryscript/event.js.snap")
4+
35
namespace
46
{
5-
IMPORT_FSTR(eventSnap, PROJECT_DIR "/out/jerryscript/event.js.snap")
67
DEFINE_FSTR(testEventName, "EVENT_TEMP")
78
HashMap<String, Vector<JS::Callable>> events;
89

test/modules/fatal.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include <JerryTest.h>
22

3+
IMPORT_FSTR_LOCAL(fatalSnap, PROJECT_DIR "/out/jerryscript/fatal.js.snap")
4+
IMPORT_FSTR_LOCAL(fatalEsNextSnap, PROJECT_DIR "/files/fatal.es.next.js.snap")
5+
36
namespace
47
{
5-
IMPORT_FSTR(fatalSnap, PROJECT_DIR "/out/jerryscript/fatal.js.snap")
6-
IMPORT_FSTR(fatalEsNextSnap, PROJECT_DIR "/files/fatal.es.next.js.snap")
7-
88
JS_DEFINE_FUNCTION(throwTantrum, JS::Value& reason)
99
{
1010
// todo

0 commit comments

Comments
 (0)