Bug 1943274

Summary: binutils-2.36.1: imake generated "ar clq" command clashes with a repurpossed ar's "l" option: ar: libdeps specified more than once
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: imakeAssignee: Petr Pisar <ppisar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ajax, caillon+fedoraproject, extras-qa, negativo17, odubaj, ppisar, rdieter, rhughes, rstrode, sandmann, tg
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: imake-1.0.8-6.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1943020 Environment:
Last Closed: 2021-03-30 08:39:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1943020    

Description Petr Pisar 2021-03-25 17:15:55 UTC
+++ This bug was initially created as a clone of Bug #1943020 +++

nas-1.9.4-24.fc35 FTBFS is triggered by upgrading binutils from 2.35.1-34.fc34 to 2.36.1-7.fc35.

[...]

The failing command is:

$ ar clq libdia.a dispatch.o dixutils.o events.o globals.o main.o resource.o swapreq.o        tables.o swaprep.o        audispatch.o auswap.o autables.o auevents.o auutil.o auconfig.o        auprocess.o  nasconf.o lex.o gram.o
ar: libdeps specified more than once

The reason is that GNU ar repurpossed an "l" option. From binutils NEWS:

* The ar tool's previously unused l modifier is now used for specifying
  dependencies of a static library. The arguments of this option
  (or --record-libdeps long form option) will be stored verbatim in the
  __.LIBDEP member of the archive, which the linker may read at link time.

--- Additional comment from Petr Pisar on 2021-03-25 17:01:27 GMT ---

The server/dia/Makefile code:

               AR = ar clq
[...]
libdia.a: $(OBJS) $(EXTRALIBRARYDEPS)
    $(RM) $@
    $(AR) $@ $(OBJS)
    $(RANLIB) $@
    $(_NULLCMD_)

is generated by xmkmf command (via imake) from server/dia/Imakefile:

NormalLibraryTarget(dia,$(OBJS))

and /usr/share/X11/config/Imake.tmpl:

#ifndef SystemV4
#define SystemV4        NO  /* SVR4 */
#endif
[...]
#ifndef HasLargeTmp
#define HasLargeTmp     NO  /* be paranoid */
#endif
[...]
#ifndef ArCmd
#if HasLargeTmp || SystemV4
#define ArCmd ArCmdBase cq
#else
#define ArCmd ArCmdBase clq
#endif
#endif

which belongs to imake-1.0.8-5.fc34.x86_64. This is a clash between imake and binutils-2.36.
-----

Who does want this ball?

imake maintainers, do you want to adapt imake templates to the new binutils (i.e. not to use "l" option), or should binutils revert the change (i.e. stop reusing "l" option)?

Comment 1 Petr Pisar 2021-03-29 09:15:23 UTC
I will push a patch I posted to the upstream if there won't be any negative reaction.

Comment 2 Petr Pisar 2021-03-30 08:39:21 UTC
Accepted by the upstream.

Comment 3 Thorsten Glaser 2021-10-23 22:07:09 UTC
Crosslinking with https://sourceware.org/bugzilla/show_bug.cgi?id=28435 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=981072

This *really* ought to be reverted in binutils. Use an upper-case ‘L’ or something instead, anything as long as it’s not currently in use anywhere else. This breaks hundreds of packages. All packages using imake, but also others.