[PATCH] D100756: [llvm-rc] [4/4] Add a GNU windres-like frontend to llvm-rc

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 05:28:14 PDT 2021


mstorsjo created this revision.
mstorsjo added reviewers: rnk, thakis, amccarth, aganea.
Herald added subscribers: pengfei, kristof.beyls, mgorny.
mstorsjo requested review of this revision.
Herald added a project: LLVM.

This primarily parses a different set of options and invokes the same
resource compiler as llvm-rc normally. Additionally, it can convert
directly to an object file (which is done with the separate cvtres tool,
or by the linker, in MSVC style setups).

(GNU windres also supports other conversions; from coff object file back
to .res, and from .res or object file back to .rc form; that's not yet
implemented.)

The other bigger complication lies in being able to imply or pass the
intended target triple, to let clang find the corresponding mingw sysroot
for finding include files, and for specifying the default output object
machine format.

It can be implied from the tool triple prefix, like
`<triple>-[llvm-]windres`, picked up from the windres option `-F pe-x86-64`
(where only BFD style format names are supported; as libbfd in binutils
doesn't support Windows on ARM, there's no such canonical name for the
ARM targets. Therefore, as an LLVM specific extension, this option is
extended to allow passing full triples.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100756

Files:
  llvm/test/tools/llvm-rc/codepage.test
  llvm/test/tools/llvm-rc/language.test
  llvm/test/tools/llvm-rc/windres-format.test
  llvm/test/tools/llvm-rc/windres-prefix.test
  llvm/test/tools/llvm-rc/windres-preproc.test
  llvm/test/tools/llvm-rc/windres-target.test
  llvm/test/tools/llvm-rc/windres-version.test
  llvm/tools/llvm-rc/CMakeLists.txt
  llvm/tools/llvm-rc/WindresOpts.td
  llvm/tools/llvm-rc/llvm-rc.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100756.338492.patch
Type: text/x-patch
Size: 36258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210419/5e6b954b/attachment.bin>


More information about the llvm-commits mailing list