]> Kevux Git Server - kevux-firewall/commitdiff
Bugfix: Linking problem with cap_free and other dependencies not being found. development
authorKevin Day <Kevin@kevux.org>
Fri, 9 Jan 2026 04:46:33 +0000 (22:46 -0600)
committerKevin Day <Kevin@kevux.org>
Fri, 9 Jan 2026 04:54:23 +0000 (22:54 -0600)
The linker has some order of operations problem where the static library being dependended on must be added after the library depending on it is declared.

Therefore `libcap.a` must be after `libfll.a` and similar.

Featureless Make might need changes to improve control over the order of linkage.

data/build/settings

index 07d4837c81db93544a94386a1dd181a38c1e4657..68a2633f0ffe9ac733b357c8538d3221d5582edc 100644 (file)
@@ -41,12 +41,17 @@ 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:libcap.a
+build_libraries_static -l:libc.a
 build_libraries_static-individual -l:libfll_error.a -l:libfll_execute.a -l:libfll_fss.a -l:libfll_print.a -l:libfll_program.a -l:libfl_control_group.a -l:libfl_conversion.a -l:libfl_environment.a -l:libfl_fss.a -l:libfl_print.a -l:libf_abstruse.a -l:libf_capability.a -l:libf_color.a -l:libf_compare.a -l:libf_console.a -l:libf_control_group.a -l:libf_conversion.a -l:libf_directory.a -l:libf_environment.a -l:libf_execute.a -l:libf_file.a -l:libf_fss.a -l:libf_limit.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_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
 
+# The libcap static must be added after libfll and others or some linkers might have problems linking and might fail to find libcap data, such as cap_free.
+build_libraries_static-individual -l:libcap.a
+build_libraries_static-level -l:libcap.a
+build_libraries_static-monolithic -l:libcap.a
+
 build_sources_headers common.h common/define.h common/enumeration.h common/string.h common/type.h
 build_sources_headers print/debug.h print/error.h print/message.h print/warning.h
 build_sources_headers operate.h operate/buffer.h operate/chains.h operate/create.h operate/default.h operate/delete.h operate/process.h operate/rules.h operate/show.h