From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10925 invoked by alias); 14 Aug 2014 22:37:57 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 10902 invoked by uid 89); 14 Aug 2014 22:37:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: OARmail.OARCORP.com Received: from oarmail.oarcorp.com (HELO OARmail.OARCORP.com) (67.63.146.244) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Aug 2014 22:37:44 +0000 Received: from [192.168.1.169] (192.168.1.169) by OARmail.OARCORP.com (192.168.2.2) with Microsoft SMTP Server (TLS) id 8.3.342.0; Thu, 14 Aug 2014 17:31:27 -0500 Message-ID: <53ED3A35.6050405@oarcorp.com> Date: Thu, 14 Aug 2014 22:37:00 -0000 From: Joel Sherrill User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "gdb@sourceware.org" Subject: Re: [PATCH 1/1] erc32 sim: Add libdl to build of sis References: <1408054866-9877-1-git-send-email-joel.sherrill@oarcorp.com> In-Reply-To: <1408054866-9877-1-git-send-email-joel.sherrill@oarcorp.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00044.txt.bz2 I just tried psim and it fails missing libdl also. Did something change in general in the simulators build procedure or does something like this need to be propagated? --joel On 8/14/2014 5:21 PM, Joel Sherrill wrote: > sis failed to link on Fedora 20 because it was not linking against > libdl. There may be a better way but this does work. > > 2013-08-14 Joel Sherrill > > * Makefile.in, configure.ac: Probe for libdl and use if available. > * configure: Regenerated > --- > sim/erc32/Makefile.in | 3 +- > sim/erc32/configure | 94 +++++++++++++++++++++++++++++++++++++++++++++----- > sim/erc32/configure.ac | 3 ++ > 3 files changed, 90 insertions(+), 10 deletions(-) > > diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in > index 0ce58a6..b5a6c4b 100644 > --- a/sim/erc32/Makefile.in > +++ b/sim/erc32/Makefile.in > @@ -20,9 +20,10 @@ > > TERMCAP_LIB = @TERMCAP@ > READLINE_LIB = @READLINE@ > +DL_LIB = @DLLIB@ > > SIM_OBJS = exec.o erc32.o func.o help.o float.o interf.o > -SIM_EXTRA_LIBS = $(READLINE_LIB) $(TERMCAP_LIB) -lm > +SIM_EXTRA_LIBS = $(READLINE_LIB) $(TERMCAP_LIB) $(DL_LIB) -lm > SIM_EXTRA_ALL = sis > SIM_EXTRA_INSTALL = install-sis > SIM_EXTRA_CLEAN = clean-sis > diff --git a/sim/erc32/configure b/sim/erc32/configure > index b8fd852..dd9882e 100755 > --- a/sim/erc32/configure > +++ b/sim/erc32/configure > @@ -601,6 +601,7 @@ ac_includes_default="\ > ac_subst_vars='LTLIBOBJS > LIBOBJS > cgen_breaks > +DLLIB > READLINE > TERMCAP > REPORT_BUGS_TEXI > @@ -1389,7 +1390,7 @@ Optional Features: > --disable-option-checking ignore unrecognized --enable/--with options > --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) > --enable-FEATURE[=ARG] include FEATURE [ARG=yes] > - --enable-plugins Enable support for plugins (defaults no) > + --enable-plugins Enable support for plugins > --enable-shared[=PKGS] build shared libraries [default=yes] > --enable-static[=PKGS] build static libraries [default=yes] > --enable-fast-install[=PKGS] > @@ -8768,15 +8769,46 @@ fi > > # BFD uses libdl when when plugins enabled. > > -# Check whether --enable-plugins was given. > + maybe_plugins=no > + for ac_header in dlfcn.h > +do : > + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default > +" > +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : > + cat >>confdefs.h <<_ACEOF > +#define HAVE_DLFCN_H 1 > +_ACEOF > + maybe_plugins=yes > +fi > + > +done > + > + for ac_header in windows.h > +do : > + ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default > +" > +if test "x$ac_cv_header_windows_h" = x""yes; then : > + cat >>confdefs.h <<_ACEOF > +#define HAVE_WINDOWS_H 1 > +_ACEOF > + maybe_plugins=yes > +fi > + > +done > + > + > + # Check whether --enable-plugins was given. > if test "${enable_plugins+set}" = set; then : > enableval=$enable_plugins; case "${enableval}" in > - yes | "") plugins=yes ;; > - no) plugins=no ;; > - *) plugins=yes ;; > - esac > + no) plugins=no ;; > + *) plugins=yes > + if test "$maybe_plugins" != "yes" ; then > + as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5 > + fi ;; > + esac > else > - plugins=no > + plugins=$maybe_plugins > + > fi > > > @@ -12265,7 +12297,7 @@ else > lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 > lt_status=$lt_dlunknown > cat > conftest.$ac_ext <<_LT_EOF > -#line 12268 "configure" > +#line 12300 "configure" > #include "confdefs.h" > > #if HAVE_DLFCN_H > @@ -12371,7 +12403,7 @@ else > lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 > lt_status=$lt_dlunknown > cat > conftest.$ac_ext <<_LT_EOF > -#line 12374 "configure" > +#line 12406 "configure" > #include "confdefs.h" > > #if HAVE_DLFCN_H > @@ -13022,6 +13054,50 @@ fi > fi > > > +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dl in -ldl" >&5 > +$as_echo_n "checking for dl in -ldl... " >&6; } > +if test "${ac_cv_lib_dl_dl+set}" = set; then : > + $as_echo_n "(cached) " >&6 > +else > + ac_check_lib_save_LIBS=$LIBS > +LIBS="-ldl $LIBS" > +cat confdefs.h - <<_ACEOF >conftest.$ac_ext > +/* end confdefs.h. */ > + > +/* Override any GCC internal prototype to avoid an error. > + Use char because int might match the return type of a GCC > + builtin and then its argument prototype would still apply. */ > +#ifdef __cplusplus > +extern "C" > +#endif > +char dl (); > +int > +main () > +{ > +return dl (); > + ; > + return 0; > +} > +_ACEOF > +if ac_fn_c_try_link "$LINENO"; then : > + ac_cv_lib_dl_dl=yes > +else > + ac_cv_lib_dl_dl=no > +fi > +rm -f core conftest.err conftest.$ac_objext \ > + conftest$ac_exeext conftest.$ac_ext > +LIBS=$ac_check_lib_save_LIBS > +fi > +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dl" >&5 > +$as_echo "$ac_cv_lib_dl_dl" >&6; } > +if test "x$ac_cv_lib_dl_dl" = x""yes; then : > + DLLIB=-ldl > +else > + : > +fi > + > + > + > ac_sources="$sim_link_files" > ac_dests="$sim_link_links" > while test -n "$ac_sources"; do > diff --git a/sim/erc32/configure.ac b/sim/erc32/configure.ac > index bc46091..21e5813 100644 > --- a/sim/erc32/configure.ac > +++ b/sim/erc32/configure.ac > @@ -32,4 +32,7 @@ else > AC_ERROR([the required "readline" library is missing]), $TERMCAP) > fi > AC_SUBST(READLINE) > + > +AC_CHECK_LIB(dl, dl, DLLIB=-ldl, :, ) > +AC_SUBST(DLLIB) > SIM_AC_OUTPUT -- Joel Sherrill, Ph.D. Director of Research & Development joel.sherrill@OARcorp.com On-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available (256) 722-9985