Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem"

This reverts commit c1eb744ff0.
This commit is contained in:
Andreas Kling 2020-05-20 14:23:31 +02:00
parent 3d02b23af5
commit 250c3b363d
Notes: sideshowbarker 2024-07-19 06:19:14 +09:00
11 changed files with 10 additions and 15 deletions

View file

@ -30,6 +30,7 @@
#include <AK/LogStream.h> #include <AK/LogStream.h>
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <AK/kmalloc.h> #include <AK/kmalloc.h>
#include <LibC/sys/arch/i386/regs.h>
#include <LibCore/File.h> #include <LibCore/File.h>
#include <LibDebug/DebugInfo.h> #include <LibDebug/DebugInfo.h>
#include <LibDebug/DebugSession.h> #include <LibDebug/DebugSession.h>
@ -40,7 +41,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/arch/i386/regs.h>
#include <unistd.h> #include <unistd.h>
static Line::Editor editor {}; static Line::Editor editor {};

View file

@ -52,7 +52,6 @@ function(serenity_libc target_name fs_name)
add_library(${target_name} ${SOURCES}) add_library(${target_name} ${SOURCES})
install(TARGETS ${target_name} ARCHIVE DESTINATION usr/lib) install(TARGETS ${target_name} ARCHIVE DESTINATION usr/lib)
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name}) set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name})
target_include_directories(${target_name} SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_directories(LibC PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_link_directories(LibC PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
endfunction() endfunction()
@ -102,9 +101,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -Wno-sized-deallocation -fno-sized-d
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG -DSANITIZE_PTRS") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG -DSANITIZE_PTRS")
add_link_options(--sysroot ${CMAKE_BINARY_DIR}/Root) add_link_options(--sysroot ${CMAKE_BINARY_DIR}/Root)
# Source directory relative service headers include_directories(Libraries/LibC)
include_directories(Services) include_directories(Services)
# Generated Service/Library Headers
include_directories(${CMAKE_CURRENT_BINARY_DIR}/Services) include_directories(${CMAKE_CURRENT_BINARY_DIR}/Services)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/Libraries) include_directories(${CMAKE_CURRENT_BINARY_DIR}/Libraries)

View file

@ -161,9 +161,6 @@ if (${CMAKE_HOST_SYSTEM_NAME} MATCHES SerenityOS)
else() else()
include_directories(../Toolchain/Local/i686-pc-serenity/include/c++/10.1.0/) include_directories(../Toolchain/Local/i686-pc-serenity/include/c++/10.1.0/)
include_directories(../Toolchain/Local/i686-pc-serenity/include/c++/10.1.0/i686-pc-serenity/) include_directories(../Toolchain/Local/i686-pc-serenity/include/c++/10.1.0/i686-pc-serenity/)
# FIXME: Many files include <LibC/sys/ioctl_numbers.h> and <LibC/errno_numbers.h>
# With -nostdinc, this makes it interesting to include these headers properly
include_directories(../Libraries/LibC)
endif() endif()
add_executable(Kernel ${SOURCES}) add_executable(Kernel ${SOURCES})

View file

@ -52,8 +52,6 @@ file(GLOB ELF_SOURCES "../LibELF/*.cpp")
set(ELF_SOURCES ${ELF_SOURCES} ../LibELF/Arch/i386/plt_trampoline.S) set(ELF_SOURCES ${ELF_SOURCES} ../LibELF/Arch/i386/plt_trampoline.S)
add_library(crt0 STATIC crt0.cpp) add_library(crt0 STATIC crt0.cpp)
# We need include headers from LibC in crt0. namely, <assert.h>
target_include_directories(crt0 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_command( add_custom_command(
TARGET crt0 TARGET crt0
COMMAND install -D $<TARGET_OBJECTS:crt0> ${CMAKE_INSTALL_PREFIX}/usr/lib/crt0.o COMMAND install -D $<TARGET_OBJECTS:crt0> ${CMAKE_INSTALL_PREFIX}/usr/lib/crt0.o

View file

@ -33,11 +33,11 @@
#include <AK/Optional.h> #include <AK/Optional.h>
#include <AK/OwnPtr.h> #include <AK/OwnPtr.h>
#include <AK/String.h> #include <AK/String.h>
#include <LibC/sys/arch/i386/regs.h>
#include <LibDebug/DebugInfo.h> #include <LibDebug/DebugInfo.h>
#include <LibELF/Loader.h> #include <LibELF/Loader.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <sys/arch/i386/regs.h>
#include <sys/ptrace.h> #include <sys/ptrace.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>

View file

@ -3,4 +3,5 @@ set(SOURCES
) )
serenity_libc(LibM m) serenity_libc(LibM m)
target_include_directories(LibM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(LibM LibC) target_link_libraries(LibM LibC)

View file

@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <assert.h> #include <LibC/assert.h>
#include <math.h> #include <LibM/math.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>

View file

@ -4,3 +4,4 @@ set(SOURCES
serenity_libc(LibPthread pthread) serenity_libc(LibPthread pthread)
target_link_libraries(LibPthread LibC) target_link_libraries(LibPthread LibC)
target_include_directories(LibPthread PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View file

@ -33,6 +33,7 @@
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <AK/kmalloc.h> #include <AK/kmalloc.h>
#include <Kernel/Syscall.h> #include <Kernel/Syscall.h>
#include <LibC/sys/arch/i386/regs.h>
#include <LibCore/File.h> #include <LibCore/File.h>
#include <LibDebug/DebugSession.h> #include <LibDebug/DebugSession.h>
#include <LibELF/Image.h> #include <LibELF/Image.h>
@ -43,7 +44,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/arch/i386/regs.h>
#include <unistd.h> #include <unistd.h>
static int usage() static int usage()

View file

@ -28,11 +28,11 @@
#include <AK/LogStream.h> #include <AK/LogStream.h>
#include <AK/Types.h> #include <AK/Types.h>
#include <Kernel/Syscall.h> #include <Kernel/Syscall.h>
#include <LibC/sys/arch/i386/regs.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/arch/i386/regs.h>
#include <sys/ptrace.h> #include <sys/ptrace.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <LibC/limits.h>
#include <LibCore/ArgsParser.h> #include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h> #include <LibCore/EventLoop.h>
#include <LibCore/File.h> #include <LibCore/File.h>
@ -36,7 +37,6 @@
#include <LibCrypto/PK/RSA.h> #include <LibCrypto/PK/RSA.h>
#include <LibLine/Editor.h> #include <LibLine/Editor.h>
#include <LibTLS/TLSv12.h> #include <LibTLS/TLSv12.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>