Git Product home page Git Product logo

Comments (6)

brunodf-snps avatar brunodf-snps commented on June 15, 2024

The issue seems a bit wider: any option starting with "-l".

Presumably this is to strip link options, but it prevents to use "-mllvm -loop-something" options such as these:
https://github.com/llvm/llvm-project/blob/f4c0c40f388fff0975ecada4997683cef3cb1fae/llvm/lib/Transforms/Scalar/LoopFlatten.cpp#L85-L103

Also when using LLVM tools inside Godbolt directly (for example, switch language to "LLVM IR" and select a version of the "opt" tool) any option starting with "-l" is removed. Here, you should be able to specify the LLVM options directly, without "-mllvm" prefix, so directly "-loop-something". This does not work.

from compiler-explorer.

mattgodbolt avatar mattgodbolt commented on June 15, 2024

At least for GCC and clang, -l gets passed to the linker as a library to link against. I can run this on my local clang:

% clang -loop-some-invalid-option -c /tmp/moo.cc
clang: warning: -loop-some-invalid-option: 'linker' input unused [-Wunused-command-line-argument]
%

no error, that's just a warning. We don't strip anything but hand all the arguments (plus a few more) to the compiler itself. In the default mode we don't link so the -l option is not processed by anything. If you enable the linker: https://godbolt.org/z/xjzETcr8G you get the error you'd expect.

from compiler-explorer.

mattgodbolt avatar mattgodbolt commented on June 15, 2024

I agree the -l option does seem to somehow get droppedf by the opt tool though,. so we still have something to investigate! :)

from compiler-explorer.

mattgodbolt avatar mattgodbolt commented on June 15, 2024

mayyybe we do filter -l stuff? argh :) we will loko. thanks again for this

from compiler-explorer.

brunodf-snps avatar brunodf-snps commented on June 15, 2024

Thanks, Matt. I should have reported my problem more directly: I cannot use LLVM command-line arguments starting with -loop, or even starting with -l. They are either ignored, or they trigger an error.

This is with clang:
https://godbolt.org/z/r15bGsjnr

This is with opt:
https://godbolt.org/z/8YdWPP3e6

from compiler-explorer.

partouf avatar partouf commented on June 15, 2024

probable culprit: #6297

from compiler-explorer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.