]> Kevux Git Server - control/commitdiff
Workaround: The compiler and linker fail to understand that compiling statically...
authorKevin Day <Kevin@kevux.org>
Thu, 8 May 2025 04:53:07 +0000 (23:53 -0500)
committerKevin Day <Kevin@kevux.org>
Thu, 8 May 2025 04:53:07 +0000 (23:53 -0500)
This is a logic or design flaw that is just plain idiotic.
When compiling statically (passing `-static`), there cannot be any shared/dynamic linked data.

Rather than recognizing this, if there is a shared library during a static build then the shared library is linked to.

The compiler and linker, at least, supports explicitly forcing the point that a static library is to be linked.
This is done via `-l:libc.a` for libc linking rather than `-lc`.

This should not be necessary, but it unfortunately is.

data/build/settings
data/build/settings.control

index ff6ea2c6bb33537bafdc84ffba5be3f4a647001a..f0f4099b0de86584396030d96af38e7bacaec236 100644 (file)
@@ -33,13 +33,21 @@ build_indexer ar
 build_indexer_arguments rcs
 build_language c
 
-build_libraries -lc
-build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program
-build_libraries-individual -lfl_conversion -lfl_fss -lfl_print -lfl_status_string
-build_libraries-individual -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf
-build_libraries-individual_thread -lf_thread
-build_libraries-level -lfll_2 -lfll_1 -lfll_0
-build_libraries-monolithic -lfll
+build_libraries_shared -lc
+build_libraries_shared-individual -lfll_error -lfll_fss -lfll_print -lfll_program
+build_libraries_shared-individual -lfl_conversion -lfl_fss -lfl_print -lfl_status_string
+build_libraries_shared-individual -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries_shared-individual_thread -lf_thread
+build_libraries_shared-level -lfll_2 -lfll_1 -lfll_0
+build_libraries_shared-monolithic -lfll
+
+build_libraries_static -l:libc.a
+build_libraries_static-individual -l:libfll_error.a -l:libfll_fss.a -l:libfll_print.a -l:libfll_program.a
+build_libraries_static-individual -l:libfl_conversion.a -l:libfl_fss.a -l:libfl_print.a -l:libfl_status_string.a
+build_libraries_static-individual -l:libf_color.a -l:libf_compare.a -l:libf_console.a -l:libf_conversion.a -l:libf_file.a -l:libf_fss.a -l:libf_memory.a -l:libf_parse.a -l:libf_path.a -l:libf_pipe.a -l:libf_print.a -l:libf_rip.a -l:libf_signal.a -l:libf_socket.a -l:libf_status_string.a -l:libf_string.a -l:libf_type_array.a -l:libf_utf.a
+build_libraries_static-individual_thread -l:libf_thread.a
+build_libraries_static-level -l:libfll_2.a -l:libfll_1.a -l:libfll_0.a
+build_libraries_static-monolithic -l:libfll.a
 
 build_sources_library common.c common/define.c common/enumeration.c common/print.c common/string.c common/type.c
 build_sources_library print/data.c print/debug.c print/error.c print/message.c print/warning.c
index 9d97f0c7c38e998af5fe116029d636e8efc023ce..d3ba11da3e6315061198bbaea2f78f14916c99c0 100644 (file)
@@ -33,14 +33,23 @@ build_indexer ar
 build_indexer_arguments rcs
 build_language c
 
-build_libraries -lc -lcontrol
-build_libraries-individual -lfll_control_group -lfll_error -lfll_fss -lfll_print -lfll_program
-build_libraries-individual_thread -lf_thread
-build_libraries-individual -lfl_conversion -lfl_fss -lfl_print -lfl_status_string
-build_libraries-individual -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_string -lf_time -lf_type_array -lf_utf
-build_libraries-individual_thread -lf_thread
-build_libraries-level -lfll_2 -lfll_1 -lfll_0
-build_libraries-monolithic -lfll
+build_libraries_shared -lc -lcontrol
+build_libraries_shared-individual -lfll_control_group -lfll_error -lfll_fss -lfll_print -lfll_program
+build_libraries_shared-individual_thread -lf_thread
+build_libraries_shared-individual -lfl_conversion -lfl_fss -lfl_print -lfl_status_string
+build_libraries_shared-individual -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_string -lf_time -lf_type_array -lf_utf
+build_libraries_shared-individual_thread -lf_thread
+build_libraries_shared-level -lfll_2 -lfll_1 -lfll_0
+build_libraries_shared-monolithic -lfll
+
+build_libraries_static -l:libc.a -l:libcontrol.a
+build_libraries_static-individual -l:libfll_control_group.a -l:libfll_error.a -l:libfll_fss.a -l:libfll_print.a -l:libfll_program.a
+build_libraries_static-individual_thread -l:libf_thread.a
+build_libraries_static-individual -l:libfl_conversion.a -l:libfl_fss.a -l:libfl_print.a -l:libfl_status_string.a
+build_libraries_static-individual -l:libf_color.a -l:libf_compare.a -l:libf_console.a -l:libf_conversion.a -l:libf_file.a -l:libf_fss.a -l:libf_memory.a -l:libf_parse.a -l:libf_path.a -l:libf_pipe.a -l:libf_print.a -l:libf_rip.a -l:libf_signal.a -l:libf_socket.a -l:libf_string.a -l:libf_time.a -l:libf_type_array.a -l:libf_utf.a
+build_libraries_static-individual_thread -l:libf_thread.a
+build_libraries_static-level -l:libfll_2.a -l:libfll_1.a -l:libfll_0.a
+build_libraries_static-monolithic -l:libfll.a
 
 build_sources_program config.c main.c control.c string.c