This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] Add a testcase for copy reloc against protected data
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 6 Mar 2015 19:09:07 +0000
- Subject: Re: [PATCH 2/2] Add a testcase for copy reloc against protected data
- Authentication-results: sourceware.org; auth=none
- References: <20150306002424 dot GA17971 at intel dot com>
On Thu, 5 Mar 2015, H.J. Lu wrote:
> if test $libc_cv_visibility_attribute = yes; then
> + AC_CACHE_CHECK(linker support for protected data symbol,
> + libc_cv_protected_data,
> + [cat > conftest.c <<EOF
> + int bar __attribute__ ((visibility ("protected"))) = 1;
> +EOF
> + libc_cv_protected_data=no
> + if AC_TRY_COMMAND(${CC-cc} -fPIC -shared conftest.c -o conftest.so); then
Use -nostdlib -nostartfiles on all configure tests involving linking so
that they work correctly in bootstrap configurations, unless there is a
clear reason they cannot work with -nostdlib -nostartfiles (in which case
there should be thorough comments about the issue).
> + cat > conftest.c <<EOF
> + extern int bar;
> + int main (void) { return bar; }
> +EOF
> + if AC_TRY_COMMAND(${CC-cc} conftest.c -o conftest conftest.so); then
Likewise; you may need to use -static as well (or LIBC_TRY_LINK_STATIC).
(Running tests may not work well in a build tree from a bootstrap build at
present, but the principle still applies that the normal case is configure
tests that allow for such configurations and any deviation needs
thoroughly justifying.)
Suppose I configure / build with new binutils but a GCC version without
your patches. What will the results be? That the tests don't build /
run? That they build / run but fail (best avoided if possible)? In
either case, you need clear documentation for architecture maintainers on
what GCC versions (*not* requiring any uncommitted GCC patches) must be
used to identify whether architecture-specific changes are needed and to
test such changes.
--
Joseph S. Myers
joseph@codesourcery.com