swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 2b04296673ea352e4d14ba4fc1b9833bebdd77b2
parent 5192aff3bcd6494b3ee785219e2dff480193d327
Author: Michael Forney <mforney@mforney.org>
Date:   Sat,  1 Nov 2014 07:07:40 +0000

Use partial linking and objcopy --localize-hidden for libswc.a

This way, we don't expose internal symbols in the static library.

Diffstat:
MMakefile | 1+
Mconfig.mk | 1+
Mlibswc/local.mk | 8+++++++-
3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -88,6 +88,7 @@ Q_AR = $(call quiet,AR ) Q_CC = $(call quiet,CC ) Q_CCLD = $(call quiet,CCLD ) Q_GEN = $(call quiet,GEN ) +Q_OBJCOPY = $(call quiet,OBJCOPY) Q_SYM = $(call quiet,SYM ) compile = $(Q_CC)$(CC) $(FINAL_CPPFLAGS) $(FINAL_CFLAGS) -I . -c -o $@ $< \ diff --git a/config.mk b/config.mk @@ -11,6 +11,7 @@ CC = gcc CFLAGS = -pipe +OBJCOPY = objcopy # PKG_CONFIG = pkg-config # WAYLAND_SCANNER = wayland-scanner diff --git a/libswc/local.mk b/libswc/local.mk @@ -83,7 +83,13 @@ $(call objects,drm drm_buffer): protocol/wayland-drm-server-protocol.h $(call objects,xdg_shell xdg_surface xdg_popup): protocol/xdg-shell-server-protocol.h $(call objects,pointer): cursor/cursor_data.h -$(dir)/libswc.a: $(SWC_STATIC_OBJECTS) +$(dir)/libswc-internal.o: $(SWC_STATIC_OBJECTS) + $(link) -nostdlib -r + +$(dir)/libswc.o: $(dir)/libswc-internal.o + $(Q_OBJCOPY)$(OBJCOPY) --localize-hidden $< $@ + +$(dir)/libswc.a: $(dir)/libswc.o $(Q_AR)$(AR) cru $@ $^ $(dir)/$(LIBSWC_LIB): $(SWC_SHARED_OBJECTS)