Skip to content

Commit 58693d9

Browse files
Fix missing _nano.a files
Libraries optimized for code size (*_nano.a) were missing from all multilibs, except for the default one. That has been happening due to an invalid script that was copying those files to installation directory - this script wasn't splitting list of multilibs properly. Signed-off-by: Anton Kolesov <[email protected]>
1 parent 83c1755 commit 58693d9

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

arc-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ get_multilibs() {
553553
if [ $IS_CROSS_COMPILING = yes ]; then
554554
echo $($orig_install_dir/bin/${arch}-elf32-gcc -print-multi-lib 2>/dev/null)
555555
else
556-
echo $(${arch}-elf32-gcc -print-multi-lib 2>/dev/null)
556+
echo $($INSTALLDIR/bin/${arch}-elf32-gcc -print-multi-lib 2>/dev/null)
557557
fi
558558
}
559559

build-elf32.sh

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,6 @@ optsize_flags="-g -ffunction-sections -fdata-sections \
313313
if [ $BUILD_OPTSIZE_NEWLIB = yes ]; then
314314
build_dir_init newlib_optsize
315315
(
316-
# Original install dir is needed to know where to copy multilib files
317-
# to, and where to get GCC executable.
318-
orig_install_dir=$INSTALLDIR
319316
PATH=$INSTALLDIR/bin:$PATH
320317
INSTALLDIR=$optsize_install_dir
321318
export CFLAGS_FOR_TARGET="$optsize_flags $CFLAGS_FOR_TARGET -Os"
@@ -333,22 +330,22 @@ if [ $BUILD_OPTSIZE_NEWLIB = yes ]; then
333330
--disable-newlib-multithread
334331
make_target building all
335332
make_target installing install
336-
337-
# Now copy multilibs. Code has been borrowed from ARM toolchain
338-
# build-common.sh file found at https://launchpad.net/gcc-arm-embedded
339-
multilibs=$(get_multilibs)
340-
for multilib in "${multilibs[@]}" ; do
341-
multi_dir="${arch}-elf32/lib/${multilib%%;*}"
342-
src_dir=$optsize_install_dir/$multi_dir
343-
dst_dir=$orig_install_dir/$multi_dir
344-
cp -f $src_dir/libc.a $dst_dir/libc_nano.a
345-
cp -f $src_dir/libg.a $dst_dir/libg_nano.a
346-
cp -f $src_dir/libm.a $dst_dir/libm_nano.a
347-
# Copy nano.specs. That one really should come from libgloss, not
348-
# from "extras" but ARC does not support libgloss yet.
349-
cp "$ARC_GNU/toolchain/extras/nano.specs" $dst_dir/
350-
done
351333
)
334+
335+
# Now copy multilibs. Code has been borrowed from ARM toolchain
336+
# build-common.sh file found at https://launchpad.net/gcc-arm-embedded
337+
multilibs=$(get_multilibs)
338+
for multilib in ${multilibs[@]} ; do
339+
multi_dir="${arch}-elf32/lib/${multilib%%;*}"
340+
src_dir=$optsize_install_dir/$multi_dir
341+
dst_dir=$INSTALLDIR/$multi_dir
342+
cp -f $src_dir/libc.a $dst_dir/libc_nano.a
343+
cp -f $src_dir/libg.a $dst_dir/libg_nano.a
344+
cp -f $src_dir/libm.a $dst_dir/libm_nano.a
345+
# Copy nano.specs. That one really should come from libgloss, not
346+
# from "extras" but ARC does not support libgloss yet.
347+
cp "$ARC_GNU/toolchain/extras/nano.specs" $dst_dir/
348+
done
352349
fi
353350

354351
# libstdc++
@@ -384,7 +381,7 @@ if [ $BUILD_OPTSIZE_LIBSTDCXX = yes ]; then
384381
# Now copy multilibs. Code has been borrowed from ARM toolchain
385382
# build-common.sh file found at https://launchpad.net/gcc-arm-embedded
386383
multilibs=$(get_multilibs)
387-
for multilib in "${multilibs[@]}" ; do
384+
for multilib in ${multilibs[@]} ; do
388385
multi_dir="${arch}-elf32/lib/${multilib%%;*}"
389386
src_dir=$optsize_install_dir/$multi_dir
390387
dst_dir=$INSTALLDIR/$multi_dir

0 commit comments

Comments
 (0)