diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-10-05 20:55:54 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-10-05 20:55:54 +0200 |
commit | c49d2df6cc3675364f51c5b4b9e35840edfb312e (patch) | |
tree | 3f08c124b012b43d45c6dc5317707ba5f8e5e905 /gcc/genmultilib | |
parent | d758c1db6bad001b7ff82cf36d075de21fa75e05 (diff) | |
download | gcc-c49d2df6cc3675364f51c5b4b9e35840edfb312e.tar.gz |
gcc.c (set_multilib_dir): Don't access *end.
* gcc.c (set_multilib_dir): Don't access *end.
Use memcpy instead of strncpy. Don't write beyond malloced buffer.
(print_multilib_info): Don't show paths starting with ".:".
* genmultilib: Add new option, "yes" if multilibs are enabled.
Update comments. If multilibs not enabled, print .:${osdirout}
for each directory. If multilibs are enabled, always print
${dirout}:${osdirout}, even if the two are the same.
* Makefile.in (s-mlib): Pass @enable_multilib@ to genmultilib.
Pass all MULTILIB_* variables to genmultilib even if
--disable-multilib but MULTILIB_OSDIRNAMES is not empty.
From-SVN: r57846
Diffstat (limited to 'gcc/genmultilib')
-rw-r--r-- | gcc/genmultilib | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/genmultilib b/gcc/genmultilib index c687537d700..ca3b71bdfa3 100644 --- a/gcc/genmultilib +++ b/gcc/genmultilib @@ -68,6 +68,9 @@ # The difference is that second argument describes multilib directories # in GCC conventions, while this one the OS multilib convention. +# The last option should be "yes" if multilibs are enabled. If it is not +# "yes", all GCC multilib dir names will be ".". + # The output looks like # #define MULTILIB_MATCHES "\ # SUBDIRECTORY OPTIONS;\ @@ -85,7 +88,7 @@ # genmultilib 'm64/m32 mno-app-regs|mcmodel=medany' '64 32 alt' # 'mcmodel?medany=mcmodel?medmid' 'm32/mno-app-regs* m32/mcmodel=*' # '' 'm32/!m64/mno-app-regs m32/!m64/mcmodel=medany' -# '../lib64 ../lib32 alt' +# '../lib64 ../lib32 alt' yes # This produces: # ". !m64 !m32 !mno-app-regs !mcmodel=medany;", # "64:../lib64 m64 !m32 !mno-app-regs !mcmodel=medany;", @@ -113,6 +116,7 @@ exceptions=$4 extra=$5 exclusions=$6 osdirnames=$7 +enable_multilib=$8 echo "static const char *const multilib_raw[] = {" @@ -292,9 +296,18 @@ for combo in ${combinations}; do osdirout=`echo ${combo} | sed ${toosdirnames}` # Remove the leading and trailing slashes. osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/$||g'` - if [ "x${dirout}" != "x${osdirout}" ]; then + if [ "x${enable_multilib}" != xyes ]; then + dirout=".:${osdirout}" + else dirout="${dirout}:${osdirout}" fi + else + if [ "x${enable_multilib}" != xyes ]; then + # genmultilib with --disable-multilib should be + # called with '' '' '' '' '' '' '' no + # if MULTILIB_OSDIRNAMES is empty. + exit 1 + fi fi # Look through the options. We must output each option that is |