Message ID | F576194C-5D60-4930-82FF-A795485C57D7@sandoe-acoustics.co.uk |
---|---|
State | New |
Headers | show |
On 08/17/2010 09:11 AM, IainS wrote:
> like this....?
Looks good to me.
r~
IainS wrote: >> Iain explained this one -- .subsections_via_symbols allows many >> of the -function-sections type tests to succeed. So, I'm really >> not sure how to proceed. Mark? Iain's version is fine by me. If necessary, there must be some way to characterize what's different about .subsections_via_symbols from ELF -function-sections.
On 17 Aug 2010, at 19:08, Mark Mitchell wrote: > IainS wrote: > >>> Iain explained this one -- .subsections_via_symbols allows many >>> of the -function-sections type tests to succeed. So, I'm really >>> not sure how to proceed. Mark? > > Iain's version is fine by me. > > If necessary, there must be some way to characterize what's different > about .subsections_via_symbols from ELF -function-sections. . subsections_via_symbols is just an assembler directive - output once at the end of the asm - the the linker does the splitting & shuffling. It is output unconditionally for Darwin as things stand (therefore, no particular test is needed). Why the other tests 'work' might take a bit more prodding - since the darwin '--gc-sections' is "-Wl,-dead_strip" - which I don't think is enabled by default. However, at least the patch proposed should get rid of the phantom fail we have - and provide a target-requires for future. Iain
On Aug 17, 2010, at 9:11 AM, IainS wrote:
> like this....?
I'm fine with this as well...
Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (revision 163308) +++ gcc/testsuite/lib/target-supports.exp (working copy) @@ -623,6 +623,20 @@ proc check_effective_target_tls_runtime {} { }] } +# Return 1 if -ffunction-sections is supported, 0 otherwise. + +proc check_effective_target_function_sections {} { + # Darwin has its own scheme and silently accepts -ffunction- sections. + global target_triplet + if { [regexp ".*-.*-darwin.*" $target_triplet] } { + return 0 + } + + return [check_no_compiler_messages functionsections assembly { + void foo (void) { } + } "-ffunction-sections"] +} + # Return 1 if compilation with -fgraphite is error-free for trivial # code, 0 otherwise.