test_ld(){
log test_ld "$@"
- flags=$(filter_out '-l*' "$@")
- libs=$(filter '-l*' "$@")
- test_cc $($cflags_filter $flags) || return
+ type=$1
+ shift 1
+ flags=$(filter_out '-l*|*.so' $@)
+ libs=$(filter '-l*|*.so' $@)
+ test_$type $($cflags_filter $flags) || return
flags=$($ldflags_filter $flags)
libs=$($ldflags_filter $libs)
- test_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
+ test_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
}
- name=$1
- shift
+ check_ld(){
+ log check_ld "$@"
- test_ld $@ && enable $name
++ type=$1
++ name=$2
++ shift 2
+ disable $name
++ test_ld $type $@ && enable $name
+ }
+
print_include(){
hdr=$1
test "${hdr%.h}" = "${hdr}" &&
:
elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
case "${cross_prefix:-$cc}" in
- *hardfloat*) enable vfp_args; fpabi=vfp ;;
- *) test_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
+ *hardfloat*) enable vfp_args; fpabi=vfp ;;
- *) check_ld vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
++ *) check_ld "cc" vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
__asm__ (".eabi_attribute 28, 1");
int main(void) { return 0; }
EOF
-Wl,--wrap,sws_scale ||
disable xmm_clobber_test
- test_ld "cc" <<EOF && enable proper_dce
-check_ld proper_dce <<EOF
++check_ld "cc" proper_dce <<EOF
extern const int array[512];
static inline int func(void) { return array[0]; }
int main(void) { return 0; }