From 112b49ab7d2af6edea6bad97f2eea98e96ed5428 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 16 Jan 2026 22:54:33 +0100 Subject: feat: implement Mach-O linker and massive improvements on Assembler and Linkers. Signed-off-by: Amlal El Mahrouss --- src/CommandLine/ld64-osx.json | 13 +++++++++++++ src/CommandLine/ld64-posix.json | 13 +++++++++++++ src/CommandLine/ld64.json | 13 ------------- src/CommandLine/mld64-osx.json | 13 +++++++++++++ src/CommandLine/mld64-posix.json | 13 +++++++++++++ src/CommandLine/mld64.cc | 15 +++++++++++++++ 6 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 src/CommandLine/ld64-osx.json create mode 100644 src/CommandLine/ld64-posix.json delete mode 100644 src/CommandLine/ld64.json create mode 100644 src/CommandLine/mld64-osx.json create mode 100644 src/CommandLine/mld64-posix.json create mode 100644 src/CommandLine/mld64.cc (limited to 'src/CommandLine') diff --git a/src/CommandLine/ld64-osx.json b/src/CommandLine/ld64-osx.json new file mode 100644 index 0000000..1a78748 --- /dev/null +++ b/src/CommandLine/ld64-osx.json @@ -0,0 +1,13 @@ +{ + "compiler_path": "clang++", + "compiler_std": "c++20", + "headers_path": ["../../include/CompilerKit", "../../include/", "../../include/CompilerKit/src/Detail"], + "sources_path": ["ld64.cc"], + "output_name": "ld64", + "compiler_flags": ["-L/usr/local/lib", "-lCompilerKit"], + "cpp_macros": [ + "__LD64__=202601", + "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" + ] +} + diff --git a/src/CommandLine/ld64-posix.json b/src/CommandLine/ld64-posix.json new file mode 100644 index 0000000..d2e626b --- /dev/null +++ b/src/CommandLine/ld64-posix.json @@ -0,0 +1,13 @@ +{ + "compiler_path": "clang++", + "compiler_std": "c++20", + "headers_path": ["../../include/CompilerKit", "../../include/", "../../include/CompilerKit/src/Detail"], + "sources_path": ["ld64.cc"], + "output_name": "ld64", + "compiler_flags": ["-L/usr/lib", "-lCompilerKit"], + "cpp_macros": [ + "__LD64__=202601", + "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" + ] +} + diff --git a/src/CommandLine/ld64.json b/src/CommandLine/ld64.json deleted file mode 100644 index dff0720..0000000 --- a/src/CommandLine/ld64.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compiler_path": "clang++", - "compiler_std": "c++20", - "headers_path": ["../../include/CompilerKit", "../../include/", "../../include/CompilerKit/src/Detail"], - "sources_path": ["ld64.cc"], - "output_name": "ld64", - "compiler_flags": ["-L/usr/lib", "-lCompilerKit"], - "cpp_macros": [ - "__LD64__=202401", - "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" - ] -} - diff --git a/src/CommandLine/mld64-osx.json b/src/CommandLine/mld64-osx.json new file mode 100644 index 0000000..78b7d3a --- /dev/null +++ b/src/CommandLine/mld64-osx.json @@ -0,0 +1,13 @@ +{ + "compiler_path": "clang++", + "compiler_std": "c++20", + "headers_path": ["../../include/CompilerKit", "../../include/", "../../include/CompilerKit/src/Detail"], + "sources_path": ["mld64.cc"], + "output_name": "mld64", + "compiler_flags": ["-L/usr/local/lib", "-lCompilerKit"], + "cpp_macros": [ + "__MLD64__=202601", + "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" + ] +} + diff --git a/src/CommandLine/mld64-posix.json b/src/CommandLine/mld64-posix.json new file mode 100644 index 0000000..0b8deab --- /dev/null +++ b/src/CommandLine/mld64-posix.json @@ -0,0 +1,13 @@ +{ + "compiler_path": "clang++", + "compiler_std": "c++20", + "headers_path": ["../../include/CompilerKit", "../../include/", "../../include/CompilerKit/src/Detail"], + "sources_path": ["mld64.cc"], + "output_name": "mld64", + "compiler_flags": ["-L/usr/lib", "-lCompilerKit"], + "cpp_macros": [ + "__MLD64__=202601", + "kDistReleaseBranch=$(git rev-parse --abbrev-ref HEAD)-$(uuidgen)" + ] +} + diff --git a/src/CommandLine/mld64.cc b/src/CommandLine/mld64.cc new file mode 100644 index 0000000..f19712b --- /dev/null +++ b/src/CommandLine/mld64.cc @@ -0,0 +1,15 @@ +// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (See accompanying +// file LICENSE or copy at http://www.apache.org/licenses/LICENSE-2.0) +// Official repository: https://github.com/nekernel-org/nectar + +#include + +/// @file ld64.cc +/// @brief Nectar linker for AE objects. + +CK_IMPORT_C Int32 DynamicLinker64MachO(Int32 argc, Char const* argv[]); + +Int32 main(Int32 argc, Char const* argv[]) { + return DynamicLinker64MachO(argc, argv); +} -- cgit v1.2.3