This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Add a testcase for copy reloc against protected data

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; 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; 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]