Skip to content

Commit

Permalink
I tried building on OpenBSD
Browse files Browse the repository at this point in the history
on the GCC CompileFarm
(cfarm220)

Change-Id: I86eced26cad8d9479bd9d0d2bc5ed1a838cff1e3
  • Loading branch information
cooljeanius committed Oct 15, 2024
1 parent d306f0d commit 4e0ac82
Show file tree
Hide file tree
Showing 29 changed files with 302 additions and 96 deletions.
3 changes: 3 additions & 0 deletions src/bfd/config.h.in

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 99 additions & 8 deletions src/bfd/configure
Original file line number Diff line number Diff line change
Expand Up @@ -20749,9 +20749,9 @@ printf "%s\n" "$as_me: trying to set lt_sysroot to prefix" >&6;}
fi
## this libtool hack is probably unnecessary now:
if test -x ${srcdir}/libtool; then
test -r libtool
test -r libtool && test -s libtool && stat libtool
if test "x${USE_MAINTAINER_MODE}" = "xyes"; then
test ! -z "${USE_MAINTAINER_MODE}"
test -n "${USE_MAINTAINER_MODE}" && echo "fixing libtool for maintainer mode"
# patch libtool to change $_cmds IFS from ~ to ? character
if grep "^[_$as_cr_letters]_cmds=.*[?]" libtool >/dev/null; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: patching libtool skipped - _cmds already contain question marks" >&5
Expand Down Expand Up @@ -21733,7 +21733,7 @@ if test ${enable_pedantic+y}
then :
enableval=$enable_pedantic; case "${enableval}" in
yes | y) PEDANTIC_WARNINGS="yes" ;;
no | n) PEDANTIC_WARNINGS="no" ;;
no | n) PEDANTIC_WARNINGS="no" ;;
*) as_fn_error $? "bad value ${enableval} for --enable-pedantic" "$LINENO" 5 ;;
esac
fi
Expand Down Expand Up @@ -21771,8 +21771,8 @@ if test "x${PEDANTIC_WARNINGS}" = "xyes"; then
WARN_CFLAGS="${WARN_CFLAGS} -Wexpansion-to-defined"
fi
## fake the '-ansi' flag; actually using it has additional effects:
WARN_CFLAGS="${WARN_CFLAGS} -D__STRICT_ANSI__"
WARN_DEFS="${WARN_DEFS} -D__STRICT_ANSI__"
WARN_CFLAGS="${WARN_CFLAGS} -D__STRICT_ANSI__ -D__PEDANTIC__"
WARN_DEFS="${WARN_DEFS} -D__STRICT_ANSI__ -DPEDANTIC_WARNINGS"
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: skipping enablement of pedantic warnings" >&5
printf "%s\n" "$as_me: skipping enablement of pedantic warnings" >&6;}
Expand Down Expand Up @@ -21972,6 +21972,7 @@ fi
printf "%s\n" "$ac_cv_path_CLANG_ANALYZER" >&6; } ## (need this extra line here)
CLANG_ANALYZER=${ac_cv_path_CLANG_ANALYZER}

## FIXME: recheck documentation on this one; I might be using the wrong value...

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fstrict-flex-arrays=1" >&5
printf %s "checking whether C compiler handles -fstrict-flex-arrays=1... " >&6; }
Expand Down Expand Up @@ -23943,7 +23944,7 @@ fi
# check arch when "main()" is the only function for which we check:
ARCHLESS_LDFLAGS="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${LD_ARCHFLAGS}"
# FIXME: Replace `main' with a function in `-lcc_dynamic':
# OK to use 'main' here:
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lcc_dynamic" >&5
printf %s "checking for main in -lcc_dynamic... " >&6; }
if test ${ac_cv_lib_cc_dynamic_main+y}
Expand Down Expand Up @@ -23983,7 +23984,7 @@ then :
SYSTEM_FRAMEWORK_LIBS="${SYSTEM_FRAMEWORK_LIBS} -lcc_dynamic"
fi

# FIXME: Replace `main' with a function in `-lgcc':
# OK to use 'main' here:
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lgcc" >&5
printf %s "checking for main in -lgcc... " >&6; }
if test ${ac_cv_lib_gcc_main+y}
Expand Down Expand Up @@ -24022,7 +24023,7 @@ if test "x$ac_cv_lib_gcc_main" = xyes
then :
SYSTEM_FRAMEWORK_LIBS="${SYSTEM_FRAMEWORK_LIBS} -lgcc"
fi
# FIXME: Replace `main' with a function in `-lSystem':
# OK to use 'main' here:
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lSystem" >&5
printf %s "checking for main in -lSystem... " >&6; }
if test ${ac_cv_lib_System_main+y}
Expand Down Expand Up @@ -24060,6 +24061,90 @@ printf "%s\n" "$ac_cv_lib_System_main" >&6; }
if test "x$ac_cv_lib_System_main" = xyes
then :
SYSTEM_FRAMEWORK_LIBS="${SYSTEM_FRAMEWORK_LIBS} -lSystem"
fi
## In case those all failed:
if test "x${SYSTEM_FRAMEWORK_LIBS}" = "x"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lcompiler_rt" >&5
printf %s "checking for main in -lcompiler_rt... " >&6; }
if test ${ac_cv_lib_compiler_rt_main+y}
then :
printf %s "(cached) " >&6
else case e in #(
e) ac_check_lib_save_LIBS=$LIBS
LIBS="-lcompiler_rt $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */


int
main (void)
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_compiler_rt_main=yes
else case e in #(
e) ac_cv_lib_compiler_rt_main=no ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS ;;
esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_compiler_rt_main" >&5
printf "%s\n" "$ac_cv_lib_compiler_rt_main" >&6; }
if test "x$ac_cv_lib_compiler_rt_main" = xyes
then :
test -z "${SYSTEM_FRAMEWORK_LIBS}" && SYSTEM_FRAMEWORK_LIBS="-lcompiler_rt"
fi

fi
## 1 more:
if test "x${SYSTEM_FRAMEWORK_LIBS}" = "x"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lclang_rt" >&5
printf %s "checking for main in -lclang_rt... " >&6; }
if test ${ac_cv_lib_clang_rt_main+y}
then :
printf %s "(cached) " >&6
else case e in #(
e) ac_check_lib_save_LIBS=$LIBS
LIBS="-lclang_rt $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */


int
main (void)
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_clang_rt_main=yes
else case e in #(
e) ac_cv_lib_clang_rt_main=no ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS ;;
esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clang_rt_main" >&5
printf "%s\n" "$ac_cv_lib_clang_rt_main" >&6; }
if test "x$ac_cv_lib_clang_rt_main" = xyes
then :
test -z "${SYSTEM_FRAMEWORK_LIBS}" && SYSTEM_FRAMEWORK_LIBS="-lclang_rt"
fi

fi
## reset these:
LDFLAGS="${ARCHLESS_LDFLAGS}"
Expand Down Expand Up @@ -24817,6 +24902,12 @@ if test "x$ac_cv_header_limits_h" = xyes
then :
printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h

fi
ac_fn_c_check_header_compile "$LINENO" "mach.h" "ac_cv_header_mach_h" "$ac_includes_default"
if test "x$ac_cv_header_mach_h" = xyes
then :
printf "%s\n" "#define HAVE_MACH_H 1" >>confdefs.h

fi
ac_fn_c_check_header_compile "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default"
if test "x$ac_cv_header_mach_mach_h" = xyes
Expand Down
23 changes: 17 additions & 6 deletions src/bfd/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ AC_DEFUN([AX_LIBTOOL_FIXES],[
])dnl
## this libtool hack is probably unnecessary now:
if test -x ${srcdir}/libtool; then
test -r libtool
test -r libtool && test -s libtool && stat libtool
if test "x${USE_MAINTAINER_MODE}" = "xyes"; then
test ! -z "${USE_MAINTAINER_MODE}"
test -n "${USE_MAINTAINER_MODE}" && echo "fixing libtool for maintainer mode"
AX_LIBTOOL_FIXES
fi
fi
Expand Down Expand Up @@ -359,6 +359,7 @@ if test "x${WANT_CONVERSION_WARNS}" = "x" && test "x${enable_build_warnings}" =
fi
AM_BINUTILS_WARNINGS
AM_BINUTILS_CLANG_STATIC_ANALYSIS
## FIXME: recheck documentation on this one; I might be using the wrong value...
gl_WARN_ADD([-fstrict-flex-arrays=1],[FLEXMEMBER_STRICTNESS_FLAG])dnl

dnl# add some insurance to our "config.h" header:
Expand Down Expand Up @@ -549,15 +550,25 @@ fi
# check arch when "main()" is the only function for which we check:
ARCHLESS_LDFLAGS="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${LD_ARCHFLAGS}"
# FIXME: Replace `main' with a function in `-lcc_dynamic':
# OK to use 'main' here:
AC_CHECK_LIB([cc_dynamic],[main],
[SYSTEM_FRAMEWORK_LIBS="${SYSTEM_FRAMEWORK_LIBS} -lcc_dynamic"])
# FIXME: Replace `main' with a function in `-lgcc':
# OK to use 'main' here:
AC_CHECK_LIB([gcc],[main],
[SYSTEM_FRAMEWORK_LIBS="${SYSTEM_FRAMEWORK_LIBS} -lgcc"])dnl
# FIXME: Replace `main' with a function in `-lSystem':
# OK to use 'main' here:
AC_CHECK_LIB([System],[main],
[SYSTEM_FRAMEWORK_LIBS="${SYSTEM_FRAMEWORK_LIBS} -lSystem"])dnl
## In case those all failed:
if test "x${SYSTEM_FRAMEWORK_LIBS}" = "x"; then
AC_CHECK_LIB([compiler_rt],[main],
[test -z "${SYSTEM_FRAMEWORK_LIBS}" && SYSTEM_FRAMEWORK_LIBS="-lcompiler_rt"])
fi
## 1 more:
if test "x${SYSTEM_FRAMEWORK_LIBS}" = "x"; then
AC_CHECK_LIB([clang_rt],[main],
[test -z "${SYSTEM_FRAMEWORK_LIBS}" && SYSTEM_FRAMEWORK_LIBS="-lclang_rt"])
fi
## reset these:
LDFLAGS="${ARCHLESS_LDFLAGS}"
## TODO: might only want to make this an error depending on platform:
Expand Down Expand Up @@ -635,7 +646,7 @@ unset ac_cv_header_limits_h
unset ac_cv_header_stdlib_h
unset ac_cv_header_sys_param_h
AC_CHECK_HEADERS([ctype.h errno.h fcntl.h gettext.h iconv.h libgen.h \
libgettext.h libintl.h limits.h mach/mach.h \
libgettext.h libintl.h limits.h mach.h mach/mach.h \
mach-o/loader.h malloca.h malloc/malloc.h math.h \
mingw/fcntl.h mingw/malloc.h mingw/sys/types.h \
realloc.h signal.h stdarg.h stddef.h stdio.h sys/acl.h \
Expand Down
2 changes: 1 addition & 1 deletion src/bfd/doc/bfdver.texi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@set VERSION 2.16.91
@set VERSION_PACKAGE (GNU Binutils)
@set UPDATED September 2024
@set UPDATED October 2024
@set BUGURL @uref{http://www.sourceware.org/bugzilla/}
2 changes: 1 addition & 1 deletion src/bfd/po/bfd.pot

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/bfd/warning.m4
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ AC_ARG_ENABLE([pedantic],
[AS_HELP_STRING([--enable-pedantic],[enable pedantic warnings])],
[case "${enableval}" in
yes | y) PEDANTIC_WARNINGS="yes" ;;
no | n) PEDANTIC_WARNINGS="no" ;;
no | n) PEDANTIC_WARNINGS="no" ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-pedantic]) ;;
esac])dnl
Expand Down Expand Up @@ -209,8 +209,8 @@ if test "x${PEDANTIC_WARNINGS}" = "xyes"; then
WARN_CFLAGS="${WARN_CFLAGS} -Wexpansion-to-defined"
fi
## fake the '-ansi' flag; actually using it has additional effects:
WARN_CFLAGS="${WARN_CFLAGS} -D__STRICT_ANSI__"
WARN_DEFS="${WARN_DEFS} -D__STRICT_ANSI__"
WARN_CFLAGS="${WARN_CFLAGS} -D__STRICT_ANSI__ -D__PEDANTIC__"
WARN_DEFS="${WARN_DEFS} -D__STRICT_ANSI__ -DPEDANTIC_WARNINGS"
else
AC_MSG_NOTICE([skipping enablement of pedantic warnings])
fi
Expand Down
Loading

0 comments on commit 4e0ac82

Please sign in to comment.