From patchwork Thu Jan 2 23:25:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 37160 Received: (qmail 113820 invoked by alias); 2 Jan 2020 23:25:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 113811 invoked by uid 89); 2 Jan 2020 23:25:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=cet, CET, influential, trustworthy X-HELO: rnd-relay.smtp.broadcom.com DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 89CC230C2B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1578007182; bh=aou8ZNdGs6RxLgJZZ4Q+UqJWpw2cpsb0VL3rJ1QTDWc=; h=From:To:Cc:Subject:Date:From; b=BIk2rkUi6g1EHp5CvFSKuhx3jITVAPYxmcj3Yj8F8nrChET6nwgUUCCjN9IvhLJim Cof7ZwezXWMbaXZFP8UzQZwS/uBMMHMwLEGImKxDI+06n1xsd2KJXAY1Um7F7Zr+bU CzpmUM8JZLjX4X9UfeGesCnEJrwU5zqYIwBl6MrU= From: justinpopo6@gmail.com To: libc-alpha@sourceware.org Cc: f.fainelli@gmail.com, code@mmayer.net, fw@deneb.enyo.de, Justin Chen Subject: [PATCH v2] configure.ac: option for user-defined-trusted-dirs Date: Thu, 2 Jan 2020 15:25:10 -0800 Message-Id: <1578007510-24831-1-git-send-email-justinpopo6@gmail.com> From: Justin Chen User-defined-trusted-dirs is a variable used for adding additional default library search dirs for the dynamic loader. Add the ability to allow users to set it from the configure script. --- INSTALL | 4 ++++ configure | 34 ++++++++++++++++++++++++++++++++-- configure.ac | 12 ++++++++++++ manual/install.texi | 5 +++++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index 392537c..1062f53 100644 --- a/INSTALL +++ b/INSTALL @@ -282,6 +282,10 @@ if 'CFLAGS' is specified it must enable optimization. For example: the GNU C Library. The default value refers to the main bug-reporting information for the GNU C Library. +'--with-user-defined-trusted-dirs=LIB-FOLDERS' + Specify additional trustworthy directories to look for shared + libraries. This is in addition to the default ld library path. + To build the library and related programs, type 'make'. This will produce a lot of output, some of which may look like errors from 'make' but aren't. Look for error messages from 'make' containing '***'. diff --git a/configure b/configure index b959d2d..2bb5534 100755 --- a/configure +++ b/configure @@ -733,6 +733,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -795,6 +796,7 @@ enable_tunables enable_mathvec enable_cet with_cpu +with_user_defined_trusted_dirs ' ac_precious_vars='build_alias host_alias @@ -846,6 +848,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1098,6 +1101,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1235,7 +1247,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1388,6 +1400,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1488,6 +1501,8 @@ Optional Packages: --with-nonshared-cflags=CFLAGS build nonshared libraries with additional CFLAGS --with-cpu=CPU select code for CPU variant + --with-user-defined-trusted-dirs=DIRS + Additional default ld search dirs Some influential environment variables: CC C compiler command @@ -3785,7 +3800,7 @@ main () { #ifndef __CET__ -#error no CET compiler support +# error no CET compiler support #endif ; return 0; @@ -3839,6 +3854,21 @@ if test "${with_cpu+set}" = set; then : fi +user_defined_trusted_dirs= + +# Check whether --with-user-defined-trusted-dirs was given. +if test "${with_user_defined_trusted_dirs+set}" = set; then : + withval=$with_user_defined_trusted_dirs; case "$withval" in + yes|'') as_fn_error $? "--with-user-defined-trusted-dirs requires an argument" "$LINENO" 5 ;; + no) ;; + *) user_defined_trusted_dirs="$withval" ;; + esac + +fi + +config_vars="$config_vars +user-defined-trusted-dirs = $user_defined_trusted_dirs" + # An preconfigure script can set this when it wants to disable the sanity # check below. libc_config_ok=no diff --git a/configure.ac b/configure.ac index 49b900c..a46532d 100644 --- a/configure.ac +++ b/configure.ac @@ -517,6 +517,18 @@ AC_ARG_WITH([cpu], esac ]) +user_defined_trusted_dirs= +AC_ARG_WITH([user-defined-trusted-dirs], + AS_HELP_STRING([--with-user-defined-trusted-dirs=DIRS], [Additional default ld search dirs]), + [dnl + case "$withval" in + yes|'') AC_MSG_ERROR([--with-user-defined-trusted-dirs requires an argument]) ;; + no) ;; + *) user_defined_trusted_dirs="$withval" ;; + esac +]) +LIBC_CONFIG_VAR([user-defined-trusted-dirs], [$user_defined_trusted_dirs]) + # An preconfigure script can set this when it wants to disable the sanity # check below. libc_config_ok=no diff --git a/manual/install.texi b/manual/install.texi index b2d569a..31ea4c1 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -312,6 +312,11 @@ Specify the URL that users should visit if they wish to report a bug, to be included in @option{--help} output from programs installed with @theglibc{}. The default value refers to the main bug-reporting information for @theglibc{}. + +@item --with-user-defined-trusted-dirs=@var{lib-folders} +Specify additional trustworthy directories to look for shared libraries. +This is in addition to the default ld library path. + @end table To build the library and related programs, type @code{make}. This will