[all-commits] [llvm/llvm-project] 282201: [Driver] Allow -e entry but reject -eentry (#72804)

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Nov 26 19:04:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 282201dc633e164042df0ae726a804c0aad46e50
      https://github.com/llvm/llvm-project/commit/282201dc633e164042df0ae726a804c0aad46e50
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-11-27 (Mon, 27 Nov 2023)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    A clang/test/Driver/entry.s

  Log Message:
  -----------
  [Driver] Allow -e entry but reject -eentry (#72804)

This short option taking an argument is unfortunate.

* If a cc1-only option starts with `-e`, using it for driver will not be
  reported as an error (e.g. commit
  6cd9886c88d16d288c74846495d89f2fe84ff827).
* If another `-e` driver option is intended but a typo is made, the
  option will be recognized as a `-e`.

`gcc -export-dynamic` passes `-export-dynamic` to ld. It's not clear
whether some options behave this way.

It seems `-Wl,-eentry` and `-Wl,--entry=entry` are primarily used. There
may also be a few `gcc -e entry`, but `gcc -eentry` is extremely rare or
not used at all. Therefore, we probably should reject the Joined form of
`-e`.




More information about the All-commits mailing list