| Message ID | 20251204100217.1368966-1-peter0x44@disroot.org |
|---|---|
| State | New |
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 04AD14BB3BC7 for <patchwork@sourceware.org>; Thu, 4 Dec 2025 10:03:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04AD14BB3BC7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1764842625; bh=HIix7h12liCfET6fn+jO2Uq3jvlMxgpZJCUdMk94a8I=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=MW7rh5LQBLBv7AxIX44JzQ/4s+rCJp+qVwTH1bgdPkxzYRPUUvUOOCZtkLN9+0OAq nAsF0vx/oPtvEzagu9iWwrsuY/zXGymFLdm//VZr5etjp1xPoFa6rykFUspUPVAe0L 8f7bxPOcLuLesZ9/CPgz+NoHQki8GGHfmHuwT4z8= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 038C14B9DB5E for <binutils@sourceware.org>; Thu, 4 Dec 2025 10:03:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 038C14B9DB5E ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 038C14B9DB5E ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764842588; cv=none; b=h+yMiYR2a6QVei0Gtg7JADwdU6KcOrvgPiqfYx2qs1optUlXUYrPKiJuPr9PW31jMSLV5XUybOyTBMOy4sNF8yZGrX/cMmTTGcRA9hBwe791OBieNIF95h2HMpxjiXeN/CTJCh2Kt7HLQS/ZBYwuxieR6d4tMa5xQaIeNBMBDc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764842588; c=relaxed/simple; bh=vLnBF4txXmyrWmap7SNVHFDKfffO+5W2qatUzWg8uNg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=B+1rUgmz1037M7A30S8vn/3POgOC2Ok9Lq/4yy57MAfjN7XkdwRqUtv47evkHgrU6H8BlJtkCt58ulv7iHpcW+7A/kMeaY18JcALdu0GOyH4ygTWs7UnUbv+eSTXmzcsYrqmh72nUyz7VZlRzBNh4MfhiPYaOw/r6bgktdKgZ44= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 038C14B9DB5E Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 097B62669A; Thu, 4 Dec 2025 11:03:07 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id vG5g1Jzk_5zB; Thu, 4 Dec 2025 11:03:06 +0100 (CET) To: binutils@sourceware.org Cc: Peter Damianov <peter0x44@disroot.org> Subject: [PATCH] Add windres to TOOL_PROGS Date: Thu, 4 Dec 2025 10:02:17 +0000 Message-ID: <20251204100217.1368966-1-peter0x44@disroot.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: Peter Damianov via Binutils <binutils@sourceware.org> Reply-To: Peter Damianov <peter0x44@disroot.org> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
Add windres to TOOL_PROGS
|
|
Commit Message
Peter Damianov
Dec. 4, 2025, 10:02 a.m. UTC
I sent a patch to GCC adding support for passing .rc and .res files to the
driver directly, allowing support for doing things like:
gcc file.c file.rc -o file.exe
However, binutils doesn't install windres into the tooldir, so by default, gcc
will be unable to find windres. This patch adds windres to TOOL_PROGS so this
can work.
binutils/ChangeLog:
* Makefile.am (TOOL_PROGS): Add windres.
* Makefile.in: Regenerate.
Signed-off-by: Peter Damianov <peter0x44@disroot.org>
---
binutils/Makefile.am | 2 +-
binutils/Makefile.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
The patch to gcc has now been applied. I'm pinging this for another review. Thanks. On 2025-12-04 11:02, Peter Damianov wrote: > I sent a patch to GCC adding support for passing .rc and .res files to > the > driver directly, allowing support for doing things like: > > gcc file.c file.rc -o file.exe > > However, binutils doesn't install windres into the tooldir, so by > default, gcc > will be unable to find windres. This patch adds windres to TOOL_PROGS > so this > can work. > > binutils/ChangeLog: > > * Makefile.am (TOOL_PROGS): Add windres. > * Makefile.in: Regenerate. > > Signed-off-by: Peter Damianov <peter0x44@disroot.org> > --- > binutils/Makefile.am | 2 +- > binutils/Makefile.in | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/binutils/Makefile.am b/binutils/Makefile.am > index 1528302ea61..4be0971b3d2 100644 > --- a/binutils/Makefile.am > +++ b/binutils/Makefile.am > @@ -110,7 +110,7 @@ noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) > @BUILD_MISC@ > EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) > $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) > > # Stuff that goes in tooldir/ if appropriate. > -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy > readelf > +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump > objcopy readelf > > BASEDIR = $(srcdir)/.. > BFDDIR = $(BASEDIR)/bfd > diff --git a/binutils/Makefile.in b/binutils/Makefile.in > index a374e805576..471b9f310dc 100644 > --- a/binutils/Makefile.in > +++ b/binutils/Makefile.in > @@ -696,7 +696,7 @@ TEST_PROGS = $(BFDTEST1_PROG) $(BFDTEST2_PROG) > $(GENTESTDLLS_PROG) > RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) > > # Stuff that goes in tooldir/ if appropriate. > -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy > readelf > +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump > objcopy readelf > BASEDIR = $(srcdir)/.. > BFDDIR = $(BASEDIR)/bfd > INCDIR = $(BASEDIR)/include
On 04.12.2025 11:02, Peter Damianov via Binutils wrote: > --- a/binutils/Makefile.am > +++ b/binutils/Makefile.am > @@ -110,7 +110,7 @@ noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) @BUILD_MISC@ > EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) > > # Stuff that goes in tooldir/ if appropriate. > -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy readelf > +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump objcopy readelf Doesn't $(WINDRES_PROG) then need taking off of $(EXTRA_PROGRAMS) (and shouldn't $(DLLTOOL_PROG) have been taken off of there when it was added to $(TOOL_PROGS))? Related, what about $(WINDMC_PROG)? To allow .mc files to be passed to the driver (once it would recognize them), wouldn't that also want moving over? Jan
On 2025-12-15 17:04, Jan Beulich wrote: > On 04.12.2025 11:02, Peter Damianov via Binutils wrote: >> --- a/binutils/Makefile.am >> +++ b/binutils/Makefile.am >> @@ -110,7 +110,7 @@ noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) >> @BUILD_MISC@ >> EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) >> $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) >> >> # Stuff that goes in tooldir/ if appropriate. >> -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy >> readelf >> +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump >> objcopy readelf > > Doesn't $(WINDRES_PROG) then need taking off of $(EXTRA_PROGRAMS) (and > shouldn't > $(DLLTOOL_PROG) have been taken off of there when it was added to > $(TOOL_PROGS))? Honestly not sure, I haven't checked this. What effect would that have? > > Related, what about $(WINDMC_PROG)? To allow .mc files to be passed to > the driver > (once it would recognize them), wouldn't that also want moving over? I have no plans to implement this. windmc actually outputs two files (a .h you are meant to include and a .rc you are meant to pass to windres). It would probably be a little strange/tricky for the driver to handle it. > > Jan Thanks for reviewing.
On 15.12.2025 17:15, Peter0x44 wrote: > On 2025-12-15 17:04, Jan Beulich wrote: >> On 04.12.2025 11:02, Peter Damianov via Binutils wrote: >>> --- a/binutils/Makefile.am >>> +++ b/binutils/Makefile.am >>> @@ -110,7 +110,7 @@ noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) >>> @BUILD_MISC@ >>> EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) >>> $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) >>> >>> # Stuff that goes in tooldir/ if appropriate. >>> -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy >>> readelf >>> +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump >>> objcopy readelf >> >> Doesn't $(WINDRES_PROG) then need taking off of $(EXTRA_PROGRAMS) (and >> shouldn't >> $(DLLTOOL_PROG) have been taken off of there when it was added to >> $(TOOL_PROGS))? > > Honestly not sure, I haven't checked this. What effect would that have? Afaict there would be no present noticeable effect, but according to "EXTRA_PROGRAMS in Automake lists programs that should be built but not installed, often for helper tools or optional components, ..." it looks wrong to me to list programs you want installed in $(EXTRA_PROGRAMS). Elsewhere, however, it is said "..., while listing all optionally built programs in EXTRA_PROGRAMS." Not knowing much automake, I fear I'm simply confused. Still it doesn't look right to me to have a program in both places. Jan
On 2025-12-15 17:44, Jan Beulich wrote: > On 15.12.2025 17:15, Peter0x44 wrote: >> On 2025-12-15 17:04, Jan Beulich wrote: >>> On 04.12.2025 11:02, Peter Damianov via Binutils wrote: >>>> --- a/binutils/Makefile.am >>>> +++ b/binutils/Makefile.am >>>> @@ -110,7 +110,7 @@ noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) >>>> @BUILD_MISC@ >>>> EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) >>>> $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) >>>> >>>> # Stuff that goes in tooldir/ if appropriate. >>>> -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy >>>> readelf >>>> +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump >>>> objcopy readelf >>> >>> Doesn't $(WINDRES_PROG) then need taking off of $(EXTRA_PROGRAMS) >>> (and >>> shouldn't >>> $(DLLTOOL_PROG) have been taken off of there when it was added to >>> $(TOOL_PROGS))? >> >> Honestly not sure, I haven't checked this. What effect would that >> have? > > Afaict there would be no present noticeable effect, but according to > "EXTRA_PROGRAMS in Automake lists programs that should be built but not > installed, often for helper tools or optional components, ..." it looks > wrong to me to list programs you want installed in $(EXTRA_PROGRAMS). > > Elsewhere, however, it is said "..., while listing all optionally built > programs in EXTRA_PROGRAMS." Not knowing much automake, I fear I'm > simply confused. Still it doesn't look right to me to have a program > in both places. OK, I'll trust your judgment and do this in v2. > > Jan Regards, Peter Damianov
On 2025-12-15 17:44, Jan Beulich wrote: > On 15.12.2025 17:15, Peter0x44 wrote: >> On 2025-12-15 17:04, Jan Beulich wrote: >>> On 04.12.2025 11:02, Peter Damianov via Binutils wrote: >>>> --- a/binutils/Makefile.am >>>> +++ b/binutils/Makefile.am >>>> @@ -110,7 +110,7 @@ noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) >>>> @BUILD_MISC@ >>>> EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) >>>> $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) >>>> >>>> # Stuff that goes in tooldir/ if appropriate. >>>> -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy >>>> readelf >>>> +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump >>>> objcopy readelf >>> >>> Doesn't $(WINDRES_PROG) then need taking off of $(EXTRA_PROGRAMS) >>> (and >>> shouldn't >>> $(DLLTOOL_PROG) have been taken off of there when it was added to >>> $(TOOL_PROGS))? >> >> Honestly not sure, I haven't checked this. What effect would that >> have? > > Afaict there would be no present noticeable effect, but according to > "EXTRA_PROGRAMS in Automake lists programs that should be built but not > installed, often for helper tools or optional components, ..." it looks > wrong to me to list programs you want installed in $(EXTRA_PROGRAMS). > > Elsewhere, however, it is said "..., while listing all optionally built > programs in EXTRA_PROGRAMS." Not knowing much automake, I fear I'm > simply confused. Still it doesn't look right to me to have a program > in both places. > > Jan -EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) +EXTRA_PROGRAMS = srconv sysdump coffdump $(WINDMC_PROG) $(DLLWRAP_PROG) -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy readelf +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump objcopy readelf I tried adding this change on top of my previous change. When I go to regenerate Makefile.in, I get this: autoreconf-2.69: configure.ac: AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION Makefile.am:487: warning: variable 'dlltool_SOURCES' is defined but no program or Makefile.am:487: library has 'dlltool' as canonical name (possible typo) Makefile.am:519: warning: variable 'windres_SOURCES' is defined but no program or Makefile.am:519: library has 'windres' as canonical name (possible typo) Makefile.am:488: warning: variable 'dlltool_LDADD' is defined but no program or Makefile.am:488: library has 'dlltool' as canonical name (possible typo) Makefile.am:521: warning: variable 'windres_LDADD' is defined but no program or Makefile.am:521: library has 'windres' as canonical name (possible typo) Makefile.am:244: warning: variable 'dlltool_DEPENDENCIES' is defined but no program or Makefile.am:244: library has 'dlltool' as canonical name (possible typo) Makefile.am:245: warning: variable 'windres_DEPENDENCIES' is defined but no program or Makefile.am:245: library has 'windres' as canonical name (possible typo) So I do think it has to exist in both and this patch is correct. Let me know if you still think otherwise. Regards, Peter Damianov.
On 16.12.2025 03:09, Peter0x44 wrote: > On 2025-12-15 17:44, Jan Beulich wrote: >> On 15.12.2025 17:15, Peter0x44 wrote: >>> On 2025-12-15 17:04, Jan Beulich wrote: >>>> On 04.12.2025 11:02, Peter Damianov via Binutils wrote: >>>>> --- a/binutils/Makefile.am >>>>> +++ b/binutils/Makefile.am >>>>> @@ -110,7 +110,7 @@ noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) >>>>> @BUILD_MISC@ >>>>> EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) >>>>> $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) >>>>> >>>>> # Stuff that goes in tooldir/ if appropriate. >>>>> -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy >>>>> readelf >>>>> +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump >>>>> objcopy readelf >>>> >>>> Doesn't $(WINDRES_PROG) then need taking off of $(EXTRA_PROGRAMS) >>>> (and >>>> shouldn't >>>> $(DLLTOOL_PROG) have been taken off of there when it was added to >>>> $(TOOL_PROGS))? >>> >>> Honestly not sure, I haven't checked this. What effect would that >>> have? >> >> Afaict there would be no present noticeable effect, but according to >> "EXTRA_PROGRAMS in Automake lists programs that should be built but not >> installed, often for helper tools or optional components, ..." it looks >> wrong to me to list programs you want installed in $(EXTRA_PROGRAMS). >> >> Elsewhere, however, it is said "..., while listing all optionally built >> programs in EXTRA_PROGRAMS." Not knowing much automake, I fear I'm >> simply confused. Still it doesn't look right to me to have a program >> in both places. >> >> Jan > > -EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) > $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) > +EXTRA_PROGRAMS = srconv sysdump coffdump $(WINDMC_PROG) $(DLLWRAP_PROG) > > -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy readelf > +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump objcopy > readelf > > I tried adding this change on top of my previous change. > > When I go to regenerate Makefile.in, I get this: > > autoreconf-2.69: configure.ac: AM_GNU_GETTEXT is used, but not > AM_GNU_GETTEXT_VERSION > Makefile.am:487: warning: variable 'dlltool_SOURCES' is defined but no > program or > Makefile.am:487: library has 'dlltool' as canonical name (possible typo) > Makefile.am:519: warning: variable 'windres_SOURCES' is defined but no > program or > Makefile.am:519: library has 'windres' as canonical name (possible typo) > Makefile.am:488: warning: variable 'dlltool_LDADD' is defined but no > program or > Makefile.am:488: library has 'dlltool' as canonical name (possible typo) > Makefile.am:521: warning: variable 'windres_LDADD' is defined but no > program or > Makefile.am:521: library has 'windres' as canonical name (possible typo) > Makefile.am:244: warning: variable 'dlltool_DEPENDENCIES' is defined but > no program or > Makefile.am:244: library has 'dlltool' as canonical name (possible typo) > Makefile.am:245: warning: variable 'windres_DEPENDENCIES' is defined but > no program or > Makefile.am:245: library has 'windres' as canonical name (possible typo) > > So I do think it has to exist in both and this patch is correct. Obviously you're right (i.e. patch is okay as is). One of the various things about automake that apparently I don't understand. Jan
diff --git a/binutils/Makefile.am b/binutils/Makefile.am index 1528302ea61..4be0971b3d2 100644 --- a/binutils/Makefile.am +++ b/binutils/Makefile.am @@ -110,7 +110,7 @@ noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) @BUILD_MISC@ EXTRA_PROGRAMS = srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG) # Stuff that goes in tooldir/ if appropriate. -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy readelf +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump objcopy readelf BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd diff --git a/binutils/Makefile.in b/binutils/Makefile.in index a374e805576..471b9f310dc 100644 --- a/binutils/Makefile.in +++ b/binutils/Makefile.in @@ -696,7 +696,7 @@ TEST_PROGS = $(BFDTEST1_PROG) $(BFDTEST2_PROG) $(GENTESTDLLS_PROG) RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) # Stuff that goes in tooldir/ if appropriate. -TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy readelf +TOOL_PROGS = nm-new strip-new ar ranlib dlltool windres objdump objcopy readelf BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd INCDIR = $(BASEDIR)/include