diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-16 14:05:51 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-16 14:05:51 +0200 |
| commit | 013998a768a00618e344069c0ad2b0048c62e329 (patch) | |
| tree | bc77a2d2ad70d523348114d3b46a2a9887f65d40 /dev/LibCompiler/src | |
| parent | 81047fcda15a6b1c68fc4de30cb25971f39a209c (diff) | |
cc, LibCompiler: source code refactor and tweaks.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/src')
| -rw-r--r-- | dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc | 6 | ||||
| -rw-r--r-- | dev/LibCompiler/src/DynamicLinkerPEF.cc | 16 |
2 files changed, 13 insertions, 9 deletions
diff --git a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc index 1d309dd..96a2873 100644 --- a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc +++ b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc @@ -1,7 +1,7 @@ /* * ======================================================== * - * c++-drv + * cxxdrv * Copyright (C) 2024-2025 Amlal El Mahrouss, all rights reserved. * * ======================================================== @@ -1126,7 +1126,7 @@ LIBCOMPILER_MODULE(CompilerCPlusPlusAMD64) std::string err = "Unknown option: "; err += argv[index]; - Detail::print_error(err, "c++-drv"); + Detail::print_error(err, "cxxdrv"); continue; } @@ -1151,7 +1151,7 @@ LIBCOMPILER_MODULE(CompilerCPlusPlusAMD64) { if (kState.fVerbose) { - Detail::print_error(argv_i + " is not a valid C++ source.\n", "c++-drv"); + Detail::print_error(argv_i + " is not a valid C++ source.\n", "cxxdrv"); } return 1; diff --git a/dev/LibCompiler/src/DynamicLinkerPEF.cc b/dev/LibCompiler/src/DynamicLinkerPEF.cc index 97f6d04..22f268c 100644 --- a/dev/LibCompiler/src/DynamicLinkerPEF.cc +++ b/dev/LibCompiler/src/DynamicLinkerPEF.cc @@ -36,8 +36,8 @@ #define MemoryCopy(DST, SRC, SZ) memcpy(DST, SRC, SZ) #define StringCompare(DST, SRC) strcmp(DST, SRC) -#define kPefNoCpu 0U -#define kPefNoSubCpu 0U +#define kPefNoCpu (0U) +#define kPefNoSubCpu (0U) #define kStdOut (std::cout << "\e[0;31m" \ << "ld64: " \ @@ -69,7 +69,7 @@ enum kABITypeInvalid = 0xFFFF, }; -static LibCompiler::String kOutput = ""; +static LibCompiler::String kOutput = "a.out"; static Int32 kAbi = kABITypeNE; static Int32 kSubArch = kPefNoSubCpu; static Int32 kArch = LibCompiler::kPefArchInvalid; @@ -79,8 +79,8 @@ static Bool kDuplicateSymbols = false; static Bool kVerbose = false; /* ld64 is to be found, mld is to be found at runtime. */ -static const char* kLdDefineSymbol = ":UndefinedSymbol:"; -static const char* kLdDynamicSym = ":RuntimeSymbol:"; +static const CharType* kLdDefineSymbol = ":UndefinedSymbol:"; +static const CharType* kLdDynamicSym = ":RuntimeSymbol:"; /* object code and list. */ static std::vector<LibCompiler::String> kObjectList; @@ -740,7 +740,9 @@ LIBCOMPILER_MODULE(DynamicLinker64PEF) } if (kVerbose) + { kStdOut << "wrote contents of: " << kOutput << "\n"; + } // step 3: check if we have those symbols @@ -770,13 +772,15 @@ LIBCOMPILER_MODULE(DynamicLinker64PEF) !unreferenced_symbols.empty()) { if (kVerbose) + { kStdOut << "file: " << kOutput << ", is corrupt, removing file...\n"; + } return LIBCOMPILER_EXEC_ERROR; } - return EXIT_SUCCESS; + return LIBCOMPILER_SUCCESSS; } // Last rev 13-1-24 |
