Closed Bug 1537703 Opened 5 years ago Closed 4 years ago

Use llvm-rc.exe instead of rc.exe when available

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox81 fixed)

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

(Blocks 1 open bug)

Details

(Keywords: in-triage)

Attachments

(1 file)

Unfortunately, contrary to windres, used for mingw builds, the build currently fails with llvm-rc, with:

llvm-rc: Error parsing file: expected '-', '~', integer or '(', got VS_FF_PRERELEASE

or

llvm-rc: Error parsing file: expected '-', '~', integer or '(', got VS_FF_DEBUG

depending if it's opt or debug.

Keywords: in-triage

So the reason we get these errors when using llvm-rc is that... drum-roll... despite accepting preprocessor options, llvm-rc doesn't preprocess. I got what look like proper resource files out of llvm-rc for a couple of our rc files by preprocessing them manually first.

Assignee: nobody → mh+mozilla
Depends on: 1656141
Blocks: 1498414

This makes us use one less tool from MSVC, and removes one more use of wine
in cross builds.

We replace the call to either rc/llvm-rc or windres with a wrapper script.
While the script is not strictly needed for the latter, we use a wrapper
in that case anyway because it's one step towards fixing bug 1498414.
For llvm-rc, however, we need a wrapper because llvm-rc doesn't preprocess
on its own, so the wrapper does that too.

The wrapper script also allows to deal with the default flags passed to
llvm-rc or windres, rather than inherit them from old-configure.

We also need to explicitly pass the codepage to llvm-rc, which was not
necessary with rc (presumably, llvm-rc has a different default).

While here, remove the unused WINDRES subst from js/src/old-configure.in.
Also, while here, we remove --use-temp-file, because as described in the
linked bug and in the windres manual page, it was used to work around bugs
on Windows 98 and earlier.

Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/fb7a0368d7b9
Use llvm-rc instead of rc.exe. r=mhentges,froydnj
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Regressions: 1658249
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: