Hi Benjamin,

On 20 January 2026 at 14:10, Benjamin Drung wrote:
| Package: r-base
| Version: 4.5.2-1
| Severity: important
| Tags: patch
| X-Debbugs-Cc: [email protected]
| 
| Dear Maintainer,
| 
| When building the pkg-config file for libR in src/unix/Makefile.in, the
| following stanza,
| 
| ```
| install-pc:
|     @$(MKINSTALLDIRS) "$(DESTDIR)$(libdir)/pkgconfig"
|     -@$(SED) -e "s:@rhome:$(rhome):" \
|       -e "s:@rincludedir:$(rincludedir):" \
|       -e "s:@rarch:$(R_ARCH):" \
|       -e 's:@libsprivate:$(STATIC_LIBR_PC):' \
|       -e 's:@others:$(MAIN_LDFLAGS) $(LDFLAGS):' \
|       -e 's/@VERSION/$(VERSION)/' $(srcdir)/libR.pc.in \
|       > "$(DESTDIR)$(libdir)/pkgconfig/libR.pc"
| ```
| 
| combines MAIN_LDFLAGS with LDFLAGS and sticks it into the "Libs" field
| of the resulting libR.pc file. That's not what you want: LDFLAGS
| contains the user's linker flags at this point, i.e. whatever they have
| in their environment variable.
| 
| On Ubuntu we started setting --package-metadata and ran into
| https://launchpad.net/bugs/2138363. The --package-metadata flag must not
| leak into the pkg-config file.
| 
| We applied the attached patch to the Ubuntu package to exclude LDFLAGS
| from libR.pc. I forwarded the patches upstream and attached the patch
| here.

I follow Bugzilla for R (actually two ways at least...) so I saw your post.

The existence of MAIN_LDFLAGS is news to me.  In any event, this almost 100%
an upstream issue so I will wait what the R Core Team, and specifically Kurt
Hornik, says here.  He has taken meticulous care of all things autoconf and
m4 and alike -- I am sure he will fold your patch in.

Cheers, Dirk
 
| -- 
| Benjamin Drung
| Debian & Ubuntu Developer
| x[DELETED ATTACHMENT 0001-Exclude-all-LDFLAGS-from-libR.pc.patch, 
application/mbox]

-- 
dirk.eddelbuettel.com | @eddelbuettel | [email protected]

Reply via email to