Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#19031 closed bug (duplicate)

gcc option -g does not work

Reported by: bhaible Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: - General Version: R1/beta5
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

For many decades, C compilers understand the option "-g" as a directive for generating debugging information. This does not work in Haiku hrev57823 (from 2024-07-15).

How to reproduce:

~> cat foo.c
int main () {}
~> gcc -g foo.c
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.2.0/../../../../x86_64-unknown-haiku/bin/as: unrecognized option `--gdwarf-5'
~> echo $?
1

Investigation:

The compiler is apparently passing options to the assembler that the assembler does not understand.

~> type as
as is /bin/as
~> ls -l /bin/as /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.2.0/../../../../x86_64-unknown-haiku/bin/as
-r-xr-xr-x 1 user root 2554496 Jun  6  2020 /bin/as
lr-xr-xr-x 1 user root      18 Jun  6  2020 /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.2.0/../../../../x86_64-unknown-haiku/bin/as -> ../../../../bin/as
~> ls -lL /bin/as /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku
/13.2.0/../../../../x86_64-unknown-haiku/bin/as
-r-xr-xr-x 1 user root 2554496 Jun  6  2020 /bin/as
-r-xr-xr-x 1 user root 2554496 Jun  6  2020 /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/13.2.0/../../../../x86_64-unknown-haiku/bin/as
~> as --version
GNU assembler (GNU Binutils) 2.31.1
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-unknown-haiku'.

The following possible fixes come to mind:

  • Upgrade binutils. The current version is 2.43.1.
  • Modify the gcc specs (cf. "gcc -dumpspecs") for the existing assembler.

Change History (2)

comment:1 by waddlesplash, 3 months ago

Resolution: duplicate
Status: newclosed

This has already been fixed in nightly images recently, and was fixed in the update repositories by upgrading binutils quite a while ago. Just run "pkgman full-sync" to get the new packages.

comment:2 by bhaible, 3 months ago

I did pkgman update binutils, and that fixes it. Thanks!

Note: See TracTickets for help on using tickets.