Chromium Code Reviews| Index: SConstruct |
| diff --git a/SConstruct b/SConstruct |
| index a2958239a73ce89667becc8dd59c85fd64662f68..59489a40fa3166a9338f50098eb0c11a77c3733b 100755 |
| --- a/SConstruct |
| +++ b/SConstruct |
| @@ -2728,13 +2728,32 @@ than via the compiler driver.""" |
| # test so don't use build id and move .rodata to the desired position. |
| args = ['--section-start', '.rodata=' + value] |
| if via_compiler: |
| - args = ','.join(['-Wl'] + args) |
| + if env.Bit('bitcode'): |
| + args = ','.join(['-Wn'] + args) |
|
Roland McGrath
2013/07/16 18:22:37
Comment about what -Wn means, since it's not a sta
|
| + else: |
| + args = ','.join(['-Wl'] + args) |
| else: |
| args = ' '.join(args) |
| return args |
| nacl_env.AddMethod(RodataSwitch) |
| +def TextSwitch(env, value): |
| + """ Return a string of arguments to place the text segment at |value|. |
| +Assume the string is going to the compiler driver, rather than directly |
| +to the linker. """ |
| + # The gold linker does not support -Ttext-segment, but -Ttext does the |
| + # same thing that -Ttext-segment does in the bfd linker. However, |
| + # -Ttext seems to be broken in gold currently (see bug |
| + # https://code.google.com/p/nativeclient/issues/detail?id=3573 ) |
| + # Using --section-start .text= as a workaround works because PNaCl only uses |
| + # one text section (no .init etc) |
| + if env.Bit('bitcode'): |
| + return '-Wn,--section-start,.text=' + value |
| + else: |
| + return '-Wl,-Ttext-segment=' + value |
| + |
| +nacl_env.AddMethod(TextSwitch) |
| def AllowNonStableBitcode(env): |
| """ This modifies the environment to allow features that aren't part |