Issue 27702 - W32-mingw: windres cannot handle concatenated .res files
Summary: W32-mingw: windres cannot handle concatenated .res files
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: OOo 1.1.1
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: tono
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks: 24588
  Show dependency tree
 
Reported: 2004-04-12 16:34 UTC by quetschke
Modified: 2013-08-07 15:35 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description quetschke 2004-04-12 16:34:22 UTC
Hi! I start a new issue for this, the main issue gets a bit crowded.

> tono: I have to apologize not to have mentioned winres.exe modification.
>
> I made modification so that winres can process concatenated .res files (with
> multiple resource headers). Microsoft tools can handle them as valid .res
> files, winres cannot.
>
> In the meantime, the issue can be solved by modifying
> solenv/inc/_?tg_(app|shl).mk.
I just had a look at them. :( the W32 build heavily depends on rc.exe's
ability to just add them together. IMHO it's a lot of work to change it to
concatenate the .rc files.

> I wonder whether is the more sophisticated solution.
My first impulse was to propose to include a windres version with your
patch in the OOo sources, we do that already for makedepend.

But this is propably not possible due to license restrictions.
vq->mh: Am I right?

> Anyways I will upload the patch for winres.
For easier reference:
<http://www.openoffice.org/nonav/issues/showattachment.cgi/14477/resres.c.patch>

vq->tono: What do yo think about a header stripper? Something that can be
          used instead of cat in this build and concatenates the .res files,
          but strips the headers of the 2..n files?

vq->ause: What do you propose?
Comment 1 hjs 2004-04-20 19:01:00 UTC
ok, looking at the patches for linking i finaly got your problem.
is "winres" able to handle several "*.res" files at all? either by merging them
to one object or creating several objects? there is still the "SHLnALLRES"
variable which knows about the single "*.res" files.
Comment 2 quetschke 2004-04-20 20:13:55 UTC
No, the manpage says:

SYNOPSIS
       windres [options] [input-file] [output-file]

DESCRIPTION
       windres  reads  resources  from  an  input file and copies them into an
----------------------------------------^^
       output file.  Either file may be in one of three formats:
       rc  A text format read by the Resource Compiler.
       res A binary format generated by the Resource Compiler.
       coff A COFF object or executable.

Only one file :( and the binutils sources in windres.c confirm that.
Comment 3 hjs 2004-04-21 11:37:40 UTC
what does this object contain? is it possible to use more than one or are there
specific symbols used so that this "resource" object has to be the opnly one?
Comment 4 quetschke 2004-04-21 15:18:04 UTC
No idea. I have only looked at main() from windres.c

tono?
Comment 5 tono 2004-04-25 01:12:38 UTC
I suspect that creating multiple COFF resource object by running windres.exe 
for each .res file should be OK, but I have not confirmed yet.
Comment 6 tono 2004-04-29 14:26:11 UTC
Experimentaly I linked multiple .o after applying windres.exe for some .res 
files. The link succeeded but when I opend the built .dll as a resource file 
with VS.NET 2003, the resources other than those in the first .res are ignored.

I think we hove to handle concatinated .res somehow.

Takashi Ono
Comment 7 Martin Hollmichel 2004-06-04 14:49:48 UTC
set target to 2.0, vq is there still any action on this ?
Comment 8 quetschke 2004-06-04 16:49:11 UTC
vq->mh: It works with the patch to windres that is described in the top entry
of this issue.

We have propably two possibilities:

* Convince the binutils people to modify windres that it acts like
  the MS version. (I think this is possible, but it takes a while until the
  fix would make it into the release version). And it is Takashis patch, he
  propably would have to get a copyright assignment first. (I guess for
  binutils he would need an assignment with redhat.)

* Write a small cleanres program that removes the extra headers from the *.res
  files. Should be fairly easy for someone that knows the .res format, basically
  delete that, what the windres patch ignores.

In fact this issue is a developer convenience issue, it's not strictly needed,
as long as you are able to rebuild windres with the patch.

We should get a 680 build running with mingw, thats a higher priority.
Comment 9 vg 2005-01-10 15:15:30 UTC
Targeted for OO later
Comment 10 tono 2009-09-12 08:58:02 UTC
Closing as the problem is fixed in recent binutils distribution.
Comment 11 tono 2009-09-12 10:06:37 UTC
Closing the issue.