From: Kevin Day Date: Thu, 8 May 2025 04:53:07 +0000 (-0500) Subject: Workaround: The compiler and linker fail to understand that compiling statically... X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=dd8f82542f3c23b98bbf6a442f78791763272495;p=control Workaround: The compiler and linker fail to understand that compiling statically should also link statically. 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. --- diff --git a/data/build/settings b/data/build/settings index ff6ea2c..f0f4099 100644 --- a/data/build/settings +++ b/data/build/settings @@ -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 diff --git a/data/build/settings.control b/data/build/settings.control index 9d97f0c..d3ba11d 100644 --- a/data/build/settings.control +++ b/data/build/settings.control @@ -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