atrstm

Load and structure a combustion gas mixture
git clone git://git.meso-star.fr/atrstm.git
Log | Files | Refs | README | LICENSE

commit ccfbfefc573f5f8160772f58591d18be0594b778
parent 31292a3dfc6dae84e30c8789bb45ed422acddb6b
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 11 Oct 2023 16:50:11 +0200

Partially link static library object files

Make hidden symbols local to the relocatable object to avoid conflicts
with internal symbols in another static library. In release mode, delete
all symbols not required for relocation processing, but keep them in
debug mode for... debugging purposes.

Diffstat:
MMakefile | 6+++++-
Mconfig.mk | 6++++++
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -53,10 +53,14 @@ $(DEP) $(OBJ): config.mk $(LIBNAME_SHARED): $(OBJ) $(CC) $(CFLAGS) $(RSYS_CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(SOFLAGS) $(DPDC_LIBS) -$(LIBNAME_STATIC): $(OBJ) +$(LIBNAME_STATIC): libatrstm.o $(AR) -rc $@ $? $(RANLIB) $@ +libatrstm.o: $(OBJ) + $(LD) -r $(OBJ) -o $@ + $(OBJCOPY) $(OCPFLAGS) $@ + .config: config.mk @if ! $(PKG_CONFIG) --atleast-version $(ATRRI_VERSION) atrri; then \ echo "atrri $(ATRRI_VERSION) not found" >&2; exit 1; fi diff --git a/config.mk b/config.mk @@ -12,6 +12,8 @@ BUILD_TYPE = RELEASE ################################################################################ AR = ar CC = cc +LD = ld +OBJCOPY = objcopy PKG_CONFIG = pkg-config RANLIB = ranlib @@ -103,3 +105,7 @@ SOFLAGS = -shared -Wl,--no-undefined LDFLAGS_DEBUG = LDFLAGS_RELEASE = -s LDFLAGS = $(LDFLAGS_$(BUILD_TYPE)) + +OCPFLAGS_DEBUG = --localize-hidden +OCPFLAGS_RELEASE = --localize-hidden --strip-unneeded +OCPFLAGS = $(OCPFLAGS_$(BUILD_TYPE))