#18551 closed bug (fixed)

-rdynamic flag broken after GCC updated to 13.1.0

Reported by: trungnt2910 Owned by: nielx
Priority: normal Milestone: Unscheduled
Component: Build System Version: R1/beta4
Keywords: regression Cc:
Blocked By: Blocking:
Platform: All

Description

Since 11.x, GCC on Haiku has added support for the -rdynamic flag. The flag is simply ignored because Haiku binaries always have that behavior by default. See also: https://github.com/haiku/buildtools/commit/9866b1a47a32306b1660ebff0efbec067545cf7f.

Now, compiling anything with the -rdynamic flag fails with:

https://github.com/haiku/buildtools/commit/9866b1a47a32306b1660ebff0efbec067545cf7f

This applies to both cross-compiling on Linux and building natively on Haiku using the package from HaikuPorts. The regression currently breaks .NET builds for Haiku.

Change History (6)

comment:1 by pulkomandy, 17 months ago

Owner: changed from nobody to nielx
Status: newassigned

comment:2 by nielx, 17 months ago

Component: Build SystemApplications
Keywords: regression added

comment:3 by nielx, 17 months ago

Component: ApplicationsBuild System

comment:4 by trungnt2910, 17 months ago

I've modified the haiku.opt file to something like this:

; Haiku options.

; Copyright (C) 2010-2022 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC is free software; you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free
; Software Foundation; either version 3, or (at your option) any later
; version.
;
; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
; WARRANTY; without even the implied warranty of MERCHANTABILITY or
; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
; for more details.
;
; You should have received a copy of the GNU General Public License
; along with GCC; see the file COPYING3.  If not see
; <http://www.gnu.org/licenses/>.

; See the GCC internals manual (options.texi) for a description of
; this file's format.

; Please try to keep this file in ASCII collating order.

pthread
Driver

rdynamic
Driver

fake
Driver

; This comment is to ensure we retain the blank line above.

And tried to use the -fake flag:

trung@DESKTOP-5OCA2N2:~$ x86_64-unknown-haiku-g++ test.cpp -o test -pthread -fake
cc1plus: error: command-line option '-fake' is valid for the driver but not for C++

This means that the haiku.opt is still valid and has an effect on the GCC driver. However, -rdynamic is still blocked:

trung@DESKTOP-5OCA2N2:~$ x86_64-unknown-haiku-g++ test.cpp -o test -pthread -rdynamic
x86_64-unknown-haiku-g++: error: unrecognized command-line option '-rdynamic'

This means between GCC 11 and GCC 13, something else must have happened that specifically affected -rdynamic (and/or probably some other related flags).

comment:5 by nielx, 17 months ago

Status: assignedin-progress

Potential solution: https://review.haiku-os.org/c/buildtools/+/6814

Tested locally with the cross-compiler, seems to work better.

comment:6 by waddlesplash, 17 months ago

Resolution: fixed
Status: in-progressclosed

merged in btrev43208; trungnt2910 confirmed it fixes the problem.

Note: See TracTickets for help on using tickets.