[PATCH] D102535: [RISCV] -mno-relax: emit .option norelax

Khem Raj via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 15:39:35 PDT 2021


raj.khem added a comment.

In D102535#2760944 <https://reviews.llvm.org/D102535#2760944>, @MaskRay wrote:

> In D102535#2760911 <https://reviews.llvm.org/D102535#2760911>, @jrtc27 wrote:
>
>> In D102535#2760899 <https://reviews.llvm.org/D102535#2760899>, @MaskRay wrote:
>>
>>> In D102535#2760807 <https://reviews.llvm.org/D102535#2760807>, @jrtc27 wrote:
>>>
>>>> I view this as a bug in whatever calls the assembler; it should be passing -mno-relax, just as it needs to pass -fPIC as appropriate.
>>>
>>> I'll use the -g analogy. `clang -S -g` emits debug info and leaves a .debug_line marker so that the assembler knows it needs to synthesize debug info and should not synthesize .debug_info from ELF symbols.
>>> The assembler doesn't need `-g` to function.
>>>
>>> For `.option nopic`, I agree it is not useful.
>>
>> The two aren't comparable. Relaxation affects assembling and not code generation. Debug info affects code generation to emit all the information that's otherwise lost (the assembly doesn't have a copy of your source code...). Even PIC is more useful than `.option norelax`, as it affects what instructions get used to lower global addresses etc.
>
> I think the -Wa,-mno-relax argument is justified if code generation cannot affect relaxation (which I am unsure).
>
> Can GCC base assembly emission decisions on -mno-relax?

I think it will be better that clang driver passed the right argument to assembler ( provided it is external GNU assembler )


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102535/new/

https://reviews.llvm.org/D102535



More information about the llvm-commits mailing list