Skip to Content.
Sympa Menu

sm-commit - [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (6d8984fd8db9ad62faa66a8cb7f40f4ff0dbdea0)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (6d8984fd8db9ad62faa66a8cb7f40f4ff0dbdea0)
  • Date: Wed, 22 Jan 2025 21:58:41 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

ChangeLog |
3
libs/libfixmath/CONFIGURE |
1
libs/libfixmath/DEPENDS |
1
libs/libfixmath/DETAILS |
17 ++
libs/libfixmath/HISTORY |
5
libs/libfixmath/PRE_BUILD |
3
libs/libfixmath/patches/0001-Add-install-rules.patch |
58 ++++++++++
libs/libfixmath/patches/0001-Check-for-UBSAN-support-before-using.patch |
35 ++++++
libs/libfixmath/patches/0001-Link-with-latomic.patch |
31 +++++
9 files changed, 154 insertions(+)

New commits:
commit 6d8984fd8db9ad62faa66a8cb7f40f4ff0dbdea0
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libfixmath: new spell, Fixed Point Math Library

diff --git a/ChangeLog b/ChangeLog
index 0edd0f6..57f35da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2025-01-22 Ismael Luceno <ismael AT sourcemage.org>
+ * libs/libfixmath: new spell, Fixed Point Math Library
+
2025-01-21 Justin Boffemmyer <flux AT sourcemage.org>
* build_system_handler.function: fix _buildsys_transform_depends

diff --git a/libs/libfixmath/CONFIGURE b/libs/libfixmath/CONFIGURE
new file mode 100755
index 0000000..b1e2770
--- /dev/null
+++ b/libs/libfixmath/CONFIGURE
@@ -0,0 +1 @@
+. "$GRIMOIRE"/CMAKE_CONFIGURE
diff --git a/libs/libfixmath/DEPENDS b/libs/libfixmath/DEPENDS
new file mode 100755
index 0000000..bd2c258
--- /dev/null
+++ b/libs/libfixmath/DEPENDS
@@ -0,0 +1 @@
+. "$GRIMOIRE"/CMAKE_DEPENDS
diff --git a/libs/libfixmath/DETAILS b/libs/libfixmath/DETAILS
new file mode 100755
index 0000000..5a548b2
--- /dev/null
+++ b/libs/libfixmath/DETAILS
@@ -0,0 +1,17 @@
+. "$GRIMOIRE"/CMAKE_FUNCTIONS
+ SPELL=libfixmath
+ VERSION=0+scm.2023-08-06
+ REF=d308e466e1a09118d03f677c52e5fbf402f6fdd0
+ SOURCE="$SPELL-$REF.tar.gz"
+ SOURCE_URL[0]=https://github.com/PetteriAimonen/$SPELL/archive/$REF.tar.gz
+
SOURCE_HASH=sha512:637de5532387fdf34dc994a85d48fabd735eea9896dfec0340c6e08b36ba3b8c37ef5ef08be85c9a48196e583f4d1dc3ddb149d395285382837b9496559c4046
+SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$REF"
+
WEB_SITE="https://github.com/PetteriAimonen/libfixmath?tab=readme-ov-file";
+ LICENSE[0]="MIT"
+ ENTERED=20250122
+ KEYWORDS=""
+ SHORT="Fixed Point Math Library"
+cat << EOF
+Libfixmath is a fixed-point math library, implementing Q16.16 format fixed
+point operations in C.
+EOF
diff --git a/libs/libfixmath/HISTORY b/libs/libfixmath/HISTORY
new file mode 100644
index 0000000..be7854f
--- /dev/null
+++ b/libs/libfixmath/HISTORY
@@ -0,0 +1,5 @@
+2025-01-22 Ismael Luceno <ismael AT sourcemage.org>
+ * CONFIGURE, DEPENDS, DETAILS, PRE_BUILD,
+ patches/0001-Add-install-rules.patch,
+ patches/0001-Check-for-UBSAN-support-before-using.patch,
+ patches/0001-Link-with-latomic.patch: spell created
diff --git a/libs/libfixmath/PRE_BUILD b/libs/libfixmath/PRE_BUILD
new file mode 100755
index 0000000..c230ad1
--- /dev/null
+++ b/libs/libfixmath/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git a/libs/libfixmath/patches/0001-Add-install-rules.patch
b/libs/libfixmath/patches/0001-Add-install-rules.patch
new file mode 100644
index 0000000..0664b29
--- /dev/null
+++ b/libs/libfixmath/patches/0001-Add-install-rules.patch
@@ -0,0 +1,58 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT sourcemage.org>
+Date: Wed, 22 Jan 2025 18:53:40 +0100
+Subject: [PATCH] Add install rules
+
+Origin: Source Mage
+Upstream-Status: Pending
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ CMakeLists.txt | 4 ++--
+ libfixmath/libfixmath.cmake | 19 ++++++++++++++++---
+ 2 files changed, 18 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a8cf98e50eee..6954b3e82a9b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -20,10 +20,10 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
+ file(GLOB fixtest-srcs fixtest/*.c fixtest/*.h)
+
+ add_executable(fixtest ${fixtest-srcs})
+- target_link_libraries(fixtest PRIVATE libfixmath m)
++ target_link_libraries(fixtest PRIVATE fixmath m)
+ target_include_directories(fixtest PRIVATE ${CMAKE_SOURCE_DIR})
+
+ add_executable(fixsingen ${fixsingen-srcs})
+- target_link_libraries(fixsingen PRIVATE libfixmath m)
++ target_link_libraries(fixsingen PRIVATE fixmath m)
+ target_include_directories(fixsingen PRIVATE ${CMAKE_SOURCE_DIR})
+ endif()
+diff --git a/libfixmath/libfixmath.cmake b/libfixmath/libfixmath.cmake
+index 138b1dedd8aa..e37ddc312876 100644
+--- a/libfixmath/libfixmath.cmake
++++ b/libfixmath/libfixmath.cmake
+@@ -3,6 +3,19 @@
+ file(GLOB libfixmath-srcs libfixmath/*.c)
+
+-add_library(libfixmath STATIC ${libfixmath-srcs})
++add_library(fixmath STATIC ${libfixmath-srcs})
+
+-target_include_directories(libfixmath INTERFACE
++target_include_directories(fixmath INTERFACE
+- ${CMAKE_CURRENT_SOURCE_DIR})
+\ No newline at end of file
++ ${CMAKE_CURRENT_SOURCE_DIR})
++
++install(TARGETS
++ fixmath
++ DESTINATION lib)
++install(FILES
++ libfixmath/fix16.h
++ libfixmath/fix16.hpp
++ libfixmath/fix16_trig_sin_lut.h
++ libfixmath/fixmath.h
++ libfixmath/fract32.h
++ libfixmath/int64.h
++ libfixmath/uint32.h
++ DESTINATION include/libfixmath)
diff --git
a/libs/libfixmath/patches/0001-Check-for-UBSAN-support-before-using.patch
b/libs/libfixmath/patches/0001-Check-for-UBSAN-support-before-using.patch
new file mode 100644
index 0000000..b82cdd2
--- /dev/null
+++ b/libs/libfixmath/patches/0001-Check-for-UBSAN-support-before-using.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT sourcemage.org>
+Date: Wed, 22 Jan 2025 22:23:04 +0100
+Subject: [PATCH] Check for UBSAN support before using
+
+Check with the compiler instead of guessing or maintaining a list.
+
+Upstream-Status: Pending
+Origin: Source Mage
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ tests/tests.cmake | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/tests/tests.cmake b/tests/tests.cmake.new
+index 2aa3b16..04e6f93 100644
+--- a/tests/tests.cmake
++++ b/tests/tests.cmake
+@@ -3,11 +3,11 @@
+ enable_testing()
+
+ # -fno-sanitize-recover
+-if(APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64")
+-# Darwin PPC does not support ubsan presently.
+- set(sanitizer_opts "")
+-else()
+- set(sanitizer_opts -fsanitize=undefined)
++set(sanitizer_opts -fsanitize=undefined)
++include(CheckLinkerFlag)
++check_linker_flag(C "${sanitizer_opts}" HAVE_UBSAN)
++if (NOT HAVE_UBSAN)
++ set(sanitizer_opts "")
+ endif()
+
+ add_custom_target(make_tests)
diff --git a/libs/libfixmath/patches/0001-Link-with-latomic.patch
b/libs/libfixmath/patches/0001-Link-with-latomic.patch
new file mode 100644
index 0000000..50177b1
--- /dev/null
+++ b/libs/libfixmath/patches/0001-Link-with-latomic.patch
@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Rene Engelhard <rene AT eller.debian.org>
+Date: Wed, 23 Mar 2022 00:00:00 +0000
+Subject: [PATCH] Link with -latomic
+
+needed e.g. on armel:
+ [ 72%] Linking C executable tests_nn64
+ /usr/bin/cmake -E cmake_link_script
CMakeFiles/tests_nn64.dir/link.txt --verbose=1
+ /usr/bin/cc -Wall -pedantic -Wextra -Werror=return-type -Wl,-z,relro
-fsanitize=undefined CMakeFiles/tests_nn64.dir/tests/tests.c.o
CMakeFiles/tests_nn64.dir/tests/tests_basic.c.o
CMakeFiles/tests_nn64.dir/tests/tests_lerp.c.o
CMakeFiles/tests_nn64.dir/tests/tests_macros.c.o
CMakeFiles/tests_nn64.dir/tests/tests_sqrt.c.o
CMakeFiles/tests_nn64.dir/tests/tests_str.c.o -o tests_nn64
liblibfixmath_nn64.a -lm
+ /usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabi/11/libubsan.so: undefined
reference to `__atomic_load_8'
+ collect2: error: ld returned 1 exit status<short summary of the patch>
+
+Origin: vendor
+Upstream-Status: Pending
+[ismael AT sourcemage.org: Normalised the patch]
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ tests/tests.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- libfixmath-0~20220222.orig/tests/tests.cmake
++++ libfixmath-0~20220222/tests/tests.cmake
+@@ -26,7 +26,7 @@ function(create_variant name defs)
+ target_compile_options(libfixmath_${name} PRIVATE ${sanitizer_opts})
+ target_link_options(libfixmath_${name} PRIVATE ${sanitizer_opts})
+ add_executable(tests_${name} ${tests-srcs})
+- target_link_libraries(tests_${name} PRIVATE libfixmath_${name} m)
++ target_link_libraries(tests_${name} PRIVATE libfixmath_${name} m atomic)
+ target_include_directories(tests_${name} PRIVATE ${CMAKE_SOURCE_DIR})
+ target_compile_definitions(tests_${name} PRIVATE ${defs})
+ target_compile_options(tests_${name} PRIVATE ${sanitizer_opts})


  • [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (6d8984fd8db9ad62faa66a8cb7f40f4ff0dbdea0), Ismael Luceno, 01/22/2025

Archive powered by MHonArc 2.6.24.

Top of Page