You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
configure: add strip flags checks
This will check if -wN '..@*' is available and fall back on -x if not; when none are available, do not run strip at all to prevent removing functions that might be actually needed.
This commit is contained in:
23
configure
vendored
23
configure
vendored
@@ -659,6 +659,10 @@ add_ldflags(){
|
|||||||
append LDFLAGS $($ldflags_filter "$@")
|
append LDFLAGS $($ldflags_filter "$@")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_stripflags(){
|
||||||
|
append STRIPFLAGS "$@"
|
||||||
|
}
|
||||||
|
|
||||||
add_extralibs(){
|
add_extralibs(){
|
||||||
prepend extralibs $($ldflags_filter "$@")
|
prepend extralibs $($ldflags_filter "$@")
|
||||||
}
|
}
|
||||||
@@ -804,6 +808,20 @@ check_ldflags(){
|
|||||||
test_ldflags "$@" && add_ldflags "$@"
|
test_ldflags "$@" && add_ldflags "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_stripflags(){
|
||||||
|
log test_stripflags "$@"
|
||||||
|
# call check_cc to get a fresh TMPO
|
||||||
|
check_cc <<EOF
|
||||||
|
int main(void) { return 0; }
|
||||||
|
EOF
|
||||||
|
check_cmd $strip $STRIPFLAGS "$@" $TMPO
|
||||||
|
}
|
||||||
|
|
||||||
|
check_stripflags(){
|
||||||
|
log check_stripflags "$@"
|
||||||
|
test_stripflags "$@" && add_stripflags "$@"
|
||||||
|
}
|
||||||
|
|
||||||
check_header(){
|
check_header(){
|
||||||
log check_header "$@"
|
log check_header "$@"
|
||||||
header=$1
|
header=$1
|
||||||
@@ -3969,6 +3987,10 @@ check_ldflags -Wl,--warn-common
|
|||||||
check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
|
check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
|
||||||
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
|
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
|
||||||
|
|
||||||
|
# add some strip flags
|
||||||
|
# -wN '..@*' is more selective than -x, but not available everywhere.
|
||||||
|
check_stripflags -wN \'..@*\' || check_stripflags -x || strip='true'
|
||||||
|
|
||||||
enabled xmm_clobber_test &&
|
enabled xmm_clobber_test &&
|
||||||
check_ldflags -Wl,--wrap,avcodec_open2 \
|
check_ldflags -Wl,--wrap,avcodec_open2 \
|
||||||
-Wl,--wrap,avcodec_decode_audio4 \
|
-Wl,--wrap,avcodec_decode_audio4 \
|
||||||
@@ -4245,6 +4267,7 @@ LD_PATH=$LD_PATH
|
|||||||
DLLTOOL=$dlltool
|
DLLTOOL=$dlltool
|
||||||
LDFLAGS=$LDFLAGS
|
LDFLAGS=$LDFLAGS
|
||||||
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
|
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
|
||||||
|
STRIPFLAGS=$STRIPFLAGS
|
||||||
YASMFLAGS=$YASMFLAGS
|
YASMFLAGS=$YASMFLAGS
|
||||||
BUILDSUF=$build_suffix
|
BUILDSUF=$build_suffix
|
||||||
FULLNAME=$FULLNAME
|
FULLNAME=$FULLNAME
|
||||||
|
@@ -25,7 +25,7 @@ $(SUBDIR)%-test.i: $(SUBDIR)%.c
|
|||||||
$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
|
$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
|
||||||
$(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
|
$(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
|
||||||
$(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
|
$(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
|
||||||
-$(STRIP) -wN '..@*' $@
|
-$(STRIP) $(STRIPFLAGS) $@
|
||||||
|
|
||||||
LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
|
LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
|
||||||
$(LIBOBJS) $(LIBOBJS:.o=.i): CPPFLAGS += -DHAVE_AV_CONFIG_H
|
$(LIBOBJS) $(LIBOBJS:.o=.i): CPPFLAGS += -DHAVE_AV_CONFIG_H
|
||||||
|
Reference in New Issue
Block a user