From: "long.wanglong" <long.wanglong@huawei.com>
To: "Bird, Tim" <Tim.Bird@sonymobile.com>, <shuahkh@osg.samsung.com>
Cc: peifeiyue <peifeiyue@huawei.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Can you give me a suggestion for how to compile size kselftest?
Date: Mon, 28 Sep 2015 10:21:27 +0800 [thread overview]
Message-ID: <5608A427.1060101@huawei.com> (raw)
In-Reply-To: <E9A9E8106200C64AB9ECC8CAE21CE73A05AB620B2E5D@seldmbx02.corpusers.net>
On 2015/9/25 4:02, Bird, Tim wrote:
> On Wednesday, September 23, 2015 8:26 PM, long.wanglong [long.wanglong@huawei.com] wrote:
>>
>> Hi, tim
>>
>> Could you help me with the following problem?
>>
>> On my x86_64 system, I can not compile the size kselftest, the output is:
>>
>> for TARGET in size; do \
>> make -C $TARGET; \
>> done;
>> make[2]: Entering directory `/home/wanglong/linux-mainline/tools/testing/selftests/size'
>> gcc -static -ffreestanding -nostartfiles -s get_size.c -o get_size
>> /usr/bin/ld: cannot find -lc
>> collect2: error: ld returned 1 exit status
>> make[2]: *** [get_size] Error 1
>> make[2]: Leaving directory `/home/wanglong/linux-mainline/tools/testing/selftests/size'
>> make[1]: *** [all] Error 2
>> make: *** [kselftest] Error 2
>>
>>
>> But, with the following command:
>> # cd tools/testing/selftests/size
>> # gcc -ffreestanding -nostartfiles -s get_size.c -o get_size
>> its ok.
>>
>> My GCC is:
>>
>> $ gcc -v
>> Using built-in specs.
>> COLLECT_GCC=gcc
>> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.3/lto-wrapper
>> Target: x86_64-redhat-linux
>> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
>> Thread model: posix
>> gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)
>>
>>
>> I google `/usr/bin/ld: cannot find -lc`, but it did not help me more.
>>
>> Could you please help me?
>
> The problem is that you are missing the version of the C library for static linking. This should be in one of
> your C library directories, with the name libc.a (not libc.so, which is the shared object library for dynamic linking).
> Sometimes the static libraries are built as separate packages.
>
>
> It looks like you need to install the 'glibc-static' development package.
>
> See http://rpmfind.net//linux/RPM/fedora/devel/rawhide/x86_64/g/glibc-static-2.22.90-6.fc24.x86_64.html
>
> Let me know if that solves the problem for you (or not).
> -- Tim
Hi Tim,
Thanks for you reply.
The reason I can not compile successfully is that, so far, the kselftests does not support -O option.
When I compile kernel without -O option, the size unit test can compile successfully.
so I hope the kselftests will support standard kernel options:
1)Separate out directory (KBUILD_OUTPUT support)
2)Verbose vs quiet building (V=1 support)
Best Regards
Wang Long
>
> .
>
parent reply other threads:[~2015-09-28 2:22 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <E9A9E8106200C64AB9ECC8CAE21CE73A05AB620B2E5D@seldmbx02.corpusers.net>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5608A427.1060101@huawei.com \
--to=long.wanglong@huawei.com \
--cc=Tim.Bird@sonymobile.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peifeiyue@huawei.com \
--cc=shuahkh@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.