* [ISSUE] ghc: fails to build; passes -g to GNU assembler
@ 2020-01-26 16:00 voidlinux-github
2020-01-26 16:05 ` voidlinux-github
2021-01-17 16:07 ` [ISSUE] [CLOSED] " pullmoll
0 siblings, 2 replies; 3+ messages in thread
From: voidlinux-github @ 2020-01-26 16:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1380 bytes --]
New issue by pullmoll on void-packages repository
https://github.com/void-linux/void-packages/issues/18571
Description:
When building `ghc` there is a problem with duplicate `.debug_line` statements emitted into the assembler files because `ghc` seems to pass `-g` to `gas` also.
This makes `gas` create its own `.debug_line` statements in addition to what was there before, where the relevant ones are those created by `ghc`.
Now since `binutils` treats such duplicated `.debug_line` statements as a fatal error, we can no longer build `ghc`. I tried to turn the fatal error into a warning and it seems this is sufficient to get `ghc` built again. Here's my patch for `binutils`:
```
--- gas/dwarf2dbg.c 2019-09-09 15:19:43.000000000 +0200
+++ gas/dwarf2dbg.c 2020-01-26 16:02:37.951224098 +0100
@@ -2224,7 +2224,7 @@
/* We can't construct a new debug_line section if we already have one.
Give an error. */
if (all_segs && !empty_debug_line)
- as_fatal ("duplicate .debug_line sections");
+ as_warn ("duplicate .debug_line sections");
if ((!all_segs && emit_other_sections)
|| (!emit_other_sections && !empty_debug_line))
```
It would however be much better to fix `ghc` and make it strip `-g` from the flags passed to `gas`. I fail to find the place where calling the assembler and passing `CFLAGS` happens, though.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ghc: fails to build; passes -g to GNU assembler
2020-01-26 16:00 [ISSUE] ghc: fails to build; passes -g to GNU assembler voidlinux-github
@ 2020-01-26 16:05 ` voidlinux-github
2021-01-17 16:07 ` [ISSUE] [CLOSED] " pullmoll
1 sibling, 0 replies; 3+ messages in thread
From: voidlinux-github @ 2020-01-26 16:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 355 bytes --]
New comment by pullmoll on void-packages repository
https://github.com/void-linux/void-packages/issues/18571#issuecomment-578516253
Comment:
N.B.: It seems you can also build `ghc` when setting `nodebug=yes` in the template. I think this is not a solution, though, because one will still encounter the errors when building something using Void's `ghc`.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [ISSUE] [CLOSED] ghc: fails to build; passes -g to GNU assembler
2020-01-26 16:00 [ISSUE] ghc: fails to build; passes -g to GNU assembler voidlinux-github
2020-01-26 16:05 ` voidlinux-github
@ 2021-01-17 16:07 ` pullmoll
1 sibling, 0 replies; 3+ messages in thread
From: pullmoll @ 2021-01-17 16:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]
Closed issue by pullmoll on void-packages repository
https://github.com/void-linux/void-packages/issues/18571
Description:
When building `ghc` there is a problem with duplicate `.debug_line` statements emitted into the assembler files because `ghc` seems to pass `-g` to `gas` also.
This makes `gas` create its own `.debug_line` statements in addition to what was there before, where the relevant ones are those created by `ghc`.
Now since `binutils` treats such duplicated `.debug_line` statements as a fatal error, we can no longer build `ghc`. I tried to turn the fatal error into a warning and it seems this is sufficient to get `ghc` built again. Here's my patch for `binutils`:
```
--- gas/dwarf2dbg.c 2019-09-09 15:19:43.000000000 +0200
+++ gas/dwarf2dbg.c 2020-01-26 16:02:37.951224098 +0100
@@ -2224,7 +2224,7 @@
/* We can't construct a new debug_line section if we already have one.
Give an error. */
if (all_segs && !empty_debug_line)
- as_fatal ("duplicate .debug_line sections");
+ as_warn ("duplicate .debug_line sections");
if ((!all_segs && emit_other_sections)
|| (!emit_other_sections && !empty_debug_line))
```
It would however be much better to fix `ghc` and make it strip `-g` from the flags passed to `gas`. I fail to find the place where calling the assembler and passing `CFLAGS` happens, though.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-17 16:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-26 16:00 [ISSUE] ghc: fails to build; passes -g to GNU assembler voidlinux-github
2020-01-26 16:05 ` voidlinux-github
2021-01-17 16:07 ` [ISSUE] [CLOSED] " pullmoll
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).