This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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, testsuite] Skip gnu-ifunc tests if building the testcase fails


>>>>> "Sandra" == Sandra Loosemore <sandra@codesourcery.com> writes:

Sandra> Here's a revised patch that adapts the same compile test that gcc
Sandra> uses. Is this one OK?

Thanks for the patch.

Sandra> +# Return true if the IFUNC feature is unsupported.
Sandra> +gdb_caching_proc skip_ifunc_tests {
Sandra> +    # Set up, compile, and execute a test program.
Sandra> +    # Include the current process ID in the file names to prevent conflicts
Sandra> +    # with invocations for multiple testsuites.
Sandra> +    set src [standard_temp_file ifunc[pid].c]
Sandra> +    set obj [standard_temp_file ifunc[pid].o]
Sandra> +
Sandra> +    verbose -log "checking for ifunc support"
Sandra> +    gdb_produce_source $src {
Sandra> +	extern void f_ ();
Sandra> +	typedef void F (void);
Sandra> +	F* g (void) { return &f_; }
Sandra> +	void f () __attribute__ ((ifunc ("g")));
Sandra> +    }
Sandra> +
Sandra> +    set lines [gdb_compile $src $obj object {quiet}]
Sandra> +    file delete $src
Sandra> +    file delete $obj


I wonder whether this could use gdb_can_simple_compile.  A recent patch
changed a bunch of other caching procs to use this helper function
instead.

I didn't examine it in detail, though, so if there is some reason it
can't be used, that's fine.

But if it can be used, this is ok with that change.

Tom


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