Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--param and other CFLAGS with arguments cause problems #10

Open
maxx23 opened this issue Sep 10, 2018 · 10 comments
Open

--param and other CFLAGS with arguments cause problems #10

maxx23 opened this issue Sep 10, 2018 · 10 comments
Labels

Comments

@maxx23
Copy link

maxx23 commented Sep 10, 2018

FlagNodupAdd() in bashrc.d/40-flag.sh also removes "--param" flag as duplicate if there is more than one "--param" since it's actual parameter is delimited by a space.

Example:
... --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 ...
becomes:
... --param l1-cache-size=32 l1-cache-line-size=64 l2-cache-size=4096 ...

There are a few more flags which should be allowed duplicate like the "-include" and "-imacros" (list by no means complete), although it is unlikely someone will specify these.

@vaeth
Copy link
Owner

vaeth commented Sep 11, 2018

The functions are not prepared at all to deal with CFLAGS with arguments
(e.g. also filtering such a flag would not be possible).

Use instead the one-parameter-form, e.g.
--param=l1-cache-size=32

@vaeth vaeth added the Question label Sep 11, 2018
@vaeth vaeth changed the title [bashrc.d/40-flag.sh]: Filters --param and potentially more as duplicate flag --param and other CFLAGS with arguments cause problems Sep 11, 2018
@maxx23
Copy link
Author

maxx23 commented Sep 11, 2018

Thank you very much! I did not know this is also legit. 👍

@sjnewbury
Copy link

How is this supposed to work with clang -mllvm, -Xclang et al? Am I missing something?

@sjnewbury
Copy link

I have my clang/llvm toolchain setup to use offloading+polly, but I can't provide the flags.

@vaeth
Copy link
Owner

vaeth commented Feb 3, 2023

This is ugly: -Xclang=... indeed does not appear to work.

One would need to hardcode explicitly a list of all parameters mandatorily requiring an argument (when we are at it, probably also for gcc). Do you have such a list?

@vaeth
Copy link
Owner

vaeth commented Feb 3, 2023

Implemented in v21.0 with the preliminary list -Xclang -mllvm --param

@sjnewbury
Copy link

  -mllvm <value>          Additional arguments to forward to LLVM's option processing
  -mmlir <value>          Additional arguments to forward to MLIR's option processing

  -Xanalyzer <arg>        Pass <arg> to the static analyzer
  -Xarch_device <arg>     Pass <arg> to the CUDA/HIP device compilation
  -Xarch_host <arg>       Pass <arg> to the CUDA/HIP host compilation
  -Xassembler <arg>       Pass <arg> to the assembler
  -Xclang <arg>           Pass <arg> to the clang compiler
  -Xcuda-fatbinary <arg>  Pass <arg> to fatbinary invocation
  -Xcuda-ptxas <arg>      Pass <arg> to the ptxas assembler
  -Xlinker <arg>          Pass <arg> to the linker
  -Xoffload-linker<triple> <arg>
                          Pass <arg> to the offload linkers or the ones idenfied by -<triple>
  -Xopenmp-target=<triple> <arg>
                          Pass <arg> to the target offloading toolchain identified by <triple>.
  -Xopenmp-target <arg>   Pass <arg> to the target offloading toolchain.
  -Xpreprocessor <arg>    Pass <arg> to the preprocessor

That's most of them. The others don't really make any sense supporting IMHO.

@sjnewbury
Copy link

Personally, I think it's a pretty stupid way of parsing arguments, but what can you do..?

@sjnewbury
Copy link

I've tested v21.0, and it's much better! I can now go ahead and do some real damage to my system! ;-)

@vaeth
Copy link
Owner

vaeth commented Feb 8, 2023

Thanks for the list. I just released 21.1 which takes it into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants