Commit da7c918e authored by Clément Bœsch's avatar Clément Bœsch

Merge commit 'c5fd4b50'

* commit 'c5fd4b50':
  build: Simplify postprocessing of linker version script files
Merged-by: 's avatarClément Bœsch <u@pkh.me>
parents c5566f0a c5fd4b50
...@@ -83,9 +83,6 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC) ...@@ -83,9 +83,6 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
%.h.c: %.h.c:
$(Q)echo '#include "$*.h"' >$@ $(Q)echo '#include "$*.h"' >$@
%.ver: %.v
$(M)sed 's/MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
%.c %.h %.ver: TAG = GEN %.c %.h %.ver: TAG = GEN
# Dummy rule to stop make trying to rebuild removed or renamed headers # Dummy rule to stop make trying to rebuild removed or renamed headers
...@@ -150,7 +147,7 @@ $(TOOLOBJS): | tools ...@@ -150,7 +147,7 @@ $(TOOLOBJS): | tools
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS)) OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS))
CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ver-sol2 *.ho *.gcno *.gcda *$(DEFAULT_YASMD).asm CLEANSUFFIXES = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver *.ho *$(DEFAULT_YASMD).asm
DISTCLEANSUFFIXES = *.pc DISTCLEANSUFFIXES = *.pc
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
......
...@@ -3148,6 +3148,7 @@ objformat="elf" ...@@ -3148,6 +3148,7 @@ objformat="elf"
pkg_config_default=pkg-config pkg_config_default=pkg-config
ranlib_default="ranlib" ranlib_default="ranlib"
strip_default="strip" strip_default="strip"
version_script='--version-script'
yasmexe_default="yasm" yasmexe_default="yasm"
windres_default="windres" windres_default="windres"
...@@ -3209,6 +3210,7 @@ SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)' ...@@ -3209,6 +3210,7 @@ SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)' SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
VERSION_SCRIPT_POSTPROCESS_CMD="cat"
asflags_filter=echo asflags_filter=echo
cflags_filter=echo cflags_filter=echo
...@@ -4627,7 +4629,8 @@ case $target_os in ...@@ -4627,7 +4629,8 @@ case $target_os in
echo "hwcap_1 = OVERRIDE;" > mapfile && echo "hwcap_1 = OVERRIDE;" > mapfile &&
add_ldflags -Wl,-M,mapfile add_ldflags -Wl,-M,mapfile
nm_default='nm -P -g' nm_default='nm -P -g'
SLIB_CREATE_DEF_CMD='$(Q)perl $(SRC_PATH)/compat/solaris/make_sunver.pl $$(filter %.ver,$$^) $(OBJS) | grep -v @ > $(SUBDIR)lib$(NAME).ver-sol2' version_script='-M'
VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
;; ;;
netbsd) netbsd)
disable symver disable symver
...@@ -6043,13 +6046,9 @@ enabled xmm_clobber_test && ...@@ -6043,13 +6046,9 @@ enabled xmm_clobber_test &&
disable xmm_clobber_test disable xmm_clobber_test
echo "X { local: *; };" > $TMPV echo "X { local: *; };" > $TMPV
if test_ldflags -Wl,--version-script,$TMPV; then if test_ldflags -Wl,${version_script},$TMPV; then
append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver' append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
elif test_ldflags -Wl,-M,$TMPV; then check_cc <<EOF && enable symver_asm_label
append SHFLAGS '-Wl,-M,\$(SUBDIR)lib\$(NAME).ver-sol2'
fi
check_cc <<EOF && enable symver_asm_label
void ff_foo(void) __asm__ ("av_foo@VERSION"); void ff_foo(void) __asm__ ("av_foo@VERSION");
void ff_foo(void) { ${inline_asm+__asm__($quotes);} } void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
EOF EOF
...@@ -6057,6 +6056,7 @@ EOF ...@@ -6057,6 +6056,7 @@ EOF
__asm__(".symver ff_foo,av_foo@VERSION"); __asm__(".symver ff_foo,av_foo@VERSION");
void ff_foo(void) {} void ff_foo(void) {}
EOF EOF
fi
if [ -z "$optflags" ]; then if [ -z "$optflags" ]; then
if enabled small; then if enabled small; then
...@@ -6588,6 +6588,7 @@ SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME} ...@@ -6588,6 +6588,7 @@ SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS} SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB} SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB} SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
SAMPLES:=${samples:-\$(FATE_SAMPLES)} SAMPLES:=${samples:-\$(FATE_SAMPLES)}
NOREDZONE_FLAGS=$noredzone_flags NOREDZONE_FLAGS=$noredzone_flags
EOF EOF
......
...@@ -40,6 +40,9 @@ $(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME) ...@@ -40,6 +40,9 @@ $(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
$$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS) $$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
$$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME) $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment