Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
libc/libm: Move math into libc, fix cos function
Browse files Browse the repository at this point in the history
  • Loading branch information
byteduck committed Apr 12, 2024
1 parent fbdaad8 commit d294ba4
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 38 deletions.
1 change: 0 additions & 1 deletion libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ADD_COMPILE_OPTIONS(-O3 -msse2)
ADD_SUBDIRECTORY(libc/)
ADD_SUBDIRECTORY(libm/)
ADD_SUBDIRECTORY(libpond/)
ADD_SUBDIRECTORY(ld/)
ADD_SUBDIRECTORY(libgraphics/)
Expand Down
6 changes: 5 additions & 1 deletion libraries/libc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SET(SOURCES
ifaddrs.c
locale.c
libgen.cpp
math.c
poll.c
pthread.cpp
sched.c
Expand Down Expand Up @@ -84,4 +85,7 @@ ADD_CUSTOM_TARGET(libc)
ADD_DEPENDENCIES(libc libc_headers libc_dyn libc_static)

# Tell linker to use libc for pthread
file(WRITE "${CMAKE_STAGING_PREFIX}/lib/libpthread.so" "INPUT(libc.so)")
file(WRITE "${CMAKE_STAGING_PREFIX}/lib/libpthread.so" "INPUT(libc.so)")
file(WRITE "${CMAKE_STAGING_PREFIX}/lib/libpthread.a" "INPUT(libc.a)")
file(WRITE "${CMAKE_STAGING_PREFIX}/lib/libm.so" "INPUT(libc.so)")
file(WRITE "${CMAKE_STAGING_PREFIX}/lib/libm.a" "INPUT(libc.a)")
2 changes: 1 addition & 1 deletion libraries/libm/math.c → libraries/libc/math.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

X87_FUNC(sqrt, fsqrt);
X87_FUNC(sin, fsin);
X87_FUNC(cos, fsin);
X87_FUNC(cos, fcos);
X87_FUNC(atan, fpatan);
X87_FUNC2(atan2, fpatan);
X87_FUNC(tan, fptan);
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions libraries/libgraphics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
SET(SOURCES Framebuffer.cpp Font.cpp Geometry.cpp Graphics.cpp Image.cpp PNG.cpp Deflate.cpp)
MAKE_LIBRARY(libgraphics)
ADD_DEPENDENCIES(libgraphics libm)
MAKE_LIBRARY(libgraphics)
25 changes: 0 additions & 25 deletions libraries/libm/CMakeLists.txt

This file was deleted.

8 changes: 0 additions & 8 deletions toolchain/build-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ install_headers() {
done <<< "$LIBC_HEADERS"
success "Installed libc headers!"

msg "Installing libm headers..."
mkdir -p "$SYSROOT"/usr/include
LIBM_HEADERS=$(find "$LIBM_LOC" -name '*.h' -print)
while IFS= read -r HEADER; do
"$INSTALL_BIN" -D "$HEADER" "$SYSROOT/usr/include/$(echo "$HEADER" | sed -e "s@$LIBM_LOC@@")"
done <<< "$LIBM_HEADERS"
success "Installed libm headers!"

msg "Installing kernel headers..."
mkdir -p "$SYSROOT"/usr/include/kernel
KERNEL_HEADERS=$(find "$KERNEL_LOC" -name '*.h' -print)
Expand Down

0 comments on commit d294ba4

Please sign in to comment.