You are not logged in.

#1 2022-01-05 20:53:23

patlefort
Member
Registered: 2021-01-30
Posts: 13

LTO and mingw: should !buildflags disable lto?

Enabling LTO in makepkg.conf is breaking most mingw packages. LTO is not supported for static libraries on mingw and stripping also is causing problems (https://archlinux.org/todo/lto-fat-objects/). Mingw packaging guidelines mandate the use of !buildflags. Should using !buildflags option also disable lto flags? Otherwise, every mingw packages will need to be revised.

Offline

#2 2022-01-06 12:22:55

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: LTO and mingw: should !buildflags disable lto?

man PKGBUILD wrote:

           buildflags
               Allow the use of user-specific buildflags (CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS) during build() as specified in
               makepkg.conf(5). More useful in its negative form !buildflags with select packages that have problems building
               with custom buildflags.

           lto
               Enable building packages using link time optimization. Adds -flto to both CFLAGS and CXXFLAGS.

Looks like it will if makepkg processes lto before buildflags is applied, but not if lto is applied after buildflags.

Someone knowledgeable in makepkg code can probably answer it, or you could add some extra statements to a PKGBUILD to verify what happens.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2022-01-06 14:35:05

patlefort
Member
Registered: 2021-01-30
Posts: 13

Re: LTO and mingw: should !buildflags disable lto?

Lone_Wolf wrote:
man PKGBUILD wrote:

           buildflags
               Allow the use of user-specific buildflags (CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS) during build() as specified in
               makepkg.conf(5). More useful in its negative form !buildflags with select packages that have problems building
               with custom buildflags.

           lto
               Enable building packages using link time optimization. Adds -flto to both CFLAGS and CXXFLAGS.

Looks like it will if makepkg processes lto before buildflags is applied, but not if lto is applied after buildflags.

Someone knowledgeable in makepkg code can probably answer it, or you could add some extra statements to a PKGBUILD to verify what happens.

I know lto will happen regardless of buildflags and that is the problem. My question is should makepkg be changed to disable lto when !buildflags is used? Or should every mingw packages changed to disable lto? I want to get some feedback before I make a bug or feature request.

Offline

#4 2022-01-06 16:41:04

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: LTO and mingw: should !buildflags disable lto?

Reread the man page and it does seem that buildflags is not intended to override lto , just (some of) the flags set in makepkg.conf # ARCHITECTURE, COMPILE FLAGS section .

If so, the documentation might benefit from a clariifcation it doesn't affect lto .

Some pacman devs do visit the forum, if none of them responds withn the next few days you may want to ask this question on the pacman-dev mailing list.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2022-01-09 10:49:56

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: LTO and mingw: should !buildflags disable lto?

Devs are on it, watch pacman-dev for answers.

https://lists.archlinux.org/pipermail/p … 25474.html


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB