FS#67092 - [nim] makepkg compiler flags should be removed after compilation

Attached to Project: Community Packages
Opened by Danil Yarantsev (Yardanico) - Tuesday, 23 June 2020, 21:07 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:01 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No


If you check https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/nim#n37 (lines from 37 to 40), you can see that the PKGBUILD adds the compilation flags to the Nim configuration (and for some reason in compiler/nim.cfg too although that's not needed since it'll use flags from the config/nim.cfg too).

The problem is - if these flags are not removed after building the compiler and all tools, the user wouldn't be able to cross-compile using GCC since Nim would always add flags like "-march=x86_64 -mtune=generic" (which were added in the PKGBUILD) to any GCC cross-compilers.

Proposed solution:
Remove these flags from the nim.cfg after building the compiler and all tools.

Initially reported in a Nim Telegram group (starts at https://t.me/nim_lang/38313)
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:01 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/nim/issues/2
Comment by Danil Yarantsev (Yardanico) - Tuesday, 23 June 2020, 21:09 GMT
To reproduce, you can install nim package itself and any cross-compiler (such as aarch64-linux-gnu-gcc), then make a hello world file like:

# hello.nim
echo "Hello world"

And try to cross-compile it with nim c --cpu:arm64 --gcc.exe="aarch64-linux-gnu-gcc" --gcc.linkerexe="aarch64-linux-gnu-gcc" hello.nim
It'll fail because -march=x86_64 -mtune=generic were passed to aarch64-linux-gnu-gcc
Comment by Toolybird (Toolybird) - Sunday, 05 March 2023, 21:33 GMT
Dupe  FS#77730 
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.