Re: [PATCH 1/5] kbuild: thin archives final link close --whole-archives option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Nicholas,

2017-06-20 0:52 GMT+09:00 Nicholas Piggin <npiggin@xxxxxxxxx>:
>>
>> masahiro@pug:~$ xtensa-linux-ld -v
>> GNU ld (GNU Binutils) 2.24
>
> Ah, thank you. It must have been that the 0day build (cc'ed) did
> not return any error to be from the ld internal error.
>
> This has led me to the true cause of the error which is the way
> external archives are handled. After implementing the fix, I think
> the lib.a size regression for thin archives should be solved as
> well.


Thanks for figuring this out!


> This patch should be added between patches 2 and 3 of this series.
>

Done.


I applied all 6 patches to linux-kbuild/thin-ar.

I fixed up some:

[1] fix a typo  "tihs"  -> "this"
[2] reword the document as "The build system has, as of 4.13, switched
to using..."
[3] Add "P" to link_vmlinux.sh as well


Could you double-check if I did them correctly?




> --- a/Makefile
> +++ b/Makefile
> @@ -952,19 +952,20 @@ core-y            := $(patsubst %/, %/built-in.o, $(core-y))
>  drivers-y      := $(patsubst %/, %/built-in.o, $(drivers-y))
>  net-y          := $(patsubst %/, %/built-in.o, $(net-y))
>  libs-y1                := $(patsubst %/, %/lib.a, $(libs-y))
> -libs-y2                := $(patsubst %/, %/built-in.o, $(libs-y))
> +libs-y2                := $(filter-out %.a, $(patsubst %/, %/built-in.o, $(libs-y)))
>  libs-y         := $(libs-y1) $(libs-y2)


After I applied this patch, I noticed one more thing.

With this patch, I think "libs-y" will be unnecessary.

If you ack me to fix-up locally, I will remove:
   libs-y         := $(libs-y1) $(libs-y2)




> @@ -50,7 +57,7 @@ archive_builtin()
>         if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
>                 info AR built-in.o
>                 rm -f built-in.o;
> -               ${AR} rcsT${KBUILD_ARFLAGS} built-in.o                  \
> +               ${AR} rcsTP${KBUILD_ARFLAGS} built-in.o                 \
>                                         ${KBUILD_VMLINUX_INIT}          \
>                                         ${KBUILD_VMLINUX_MAIN}
>         fi

I moved this hunk to  2/6 "thin archives use P option to ar".


-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux