Opened 7 months ago

Last modified 6 months ago

#72736 assigned defect

arm-none-eabi-gdb does not build

Reported by: pmetzger (Perry E. Metzger) Owned by: judaew (Vadym-Valdis Yudaiev)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: arm-none-eabi-gdb

Description

The current arm-none-eabi-gdb port (13.1) produces several errors during build like:

:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/stdio.h:61:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/_stdio.h:318:7: error: expected identifier or '('
:info:build   318 | FILE    *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
:info:build       |          ^
:info:build /opt/local/var/macports/build/arm-none-eabi-gdb-5f0004ef/work/gdb-13.1/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
:info:build   147 | #        define fdopen(fd,mode) NULL /* No fdopen() */
:info:build       |                                 ^
:info:build /Library/Developer/CommandLineTools/usr/lib/clang/17/include/__stddef_null.h:26:16: note: expanded from macro 'NULL'
:info:build    26 | #define NULL ((void*)0)
:info:build       |                ^
:info:build In file included from /opt/local/var/macports/build/arm-none-eabi-gdb-5f0004ef/work/gdb-13.1/zlib/zutil.c:10:
:info:build In file included from /opt/local/var/macports/build/arm-none-eabi-gdb-5f0004ef/work/gdb-13.1/zlib/gzguts.h:21:
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/stdio.h:61:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/_stdio.h:318:7: error: expected ')'
:info:build /opt/local/var/macports/build/arm-none-eabi-gdb-5f0004ef/work/gdb-13.1/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
:info:build   147 | #        define fdopen(fd,mode) NULL /* No fdopen() */
:info:build       |                                 ^
:info:build /Library/Developer/CommandLineTools/usr/lib/clang/17/include/__stddef_null.h:26:16: note: expanded from macro 'NULL'
:info:build    26 | #define NULL ((void*)0)
:info:build       |                ^
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/_stdio.h:318:7: note: to match this '('
:info:build /opt/local/var/macports/build/arm-none-eabi-gdb-5f0004ef/work/gdb-13.1/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
:info:build   147 | #        define fdopen(fd,mode) NULL /* No fdopen() */
:info:build       |                                 ^
:info:build /Library/Developer/CommandLineTools/usr/lib/clang/17/include/__stddef_null.h:26:15: note: expanded from macro 'NULL'
:info:build    26 | #define NULL ((void*)0)
:info:build       |               ^
:info:build In file included from /opt/local/var/macports/build/arm-none-eabi-gdb-5f0004ef/work/gdb-13.1/zlib/zutil.c:10:
:info:build In file included from /opt/local/var/macports/build/arm-none-eabi-gdb-5f0004ef/work/gdb-13.1/zlib/gzguts.h:21:
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/stdio.h:61:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/_stdio.h:318:7: error: expected ')'

Attachments (1)

main.log (482.6 KB) - added by pmetzger (Perry E. Metzger) 7 months ago.
main.log following fix of zlib problem

Download all attachments as: .zip

Change History (13)

comment:1 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to judaew
Status: newassigned

The problem is an outdated bundled copy of zlib. The problem was fixed in zlib 1.3.1. The solution is for gdb to use MacPorts zlib instead, or apply a patch to the bundled zlib, as explained in #72693.

comment:2 Changed 7 months ago by pmetzger (Perry E. Metzger)

I have temporarily added a patch to the bundled zlib but clearly this cannot be the long term solution.

comment:3 Changed 7 months ago by pmetzger (Perry E. Metzger)

I have now committed a change to the portgroup to add "--with-system-zlib"; I haven't closed the ticket.

comment:4 Changed 7 months ago by pmetzger (Perry E. Metzger)

(Presuming this works, I think it means we have to bump the rev on everything in the crossgdb portgroup?)

Changed 7 months ago by pmetzger (Perry E. Metzger)

Attachment: main.log added

main.log following fix of zlib problem

comment:5 Changed 7 months ago by pmetzger (Perry E. Metzger)

So it appears that the zlib issue is fixed, but now we proceed along and hit something else.

It's lots of stuff of the form:

build /opt/local/var/macports/build/arm-none-eabi-gdb-5f0004ef/work/gdb-13.1/gdb/../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 15] for the enumeration type 'ui_out_flag' [-Wenum-constexpr-conversion]
Last edited 7 months ago by pmetzger (Perry E. Metzger) (previous) (diff)

comment:6 in reply to:  5 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to pmetzger:

I have now committed a change to the portgroup to add "--with-system-zlib"

For reference, that was [7ab9fb32c9ebc613585f8baeac1d3f8b9ed01016/macports-ports].

What about adding the port:zlib library dependency? Should that also be done by the portgroup?

Replying to pmetzger:

(Presuming this works, I think it means we have to bump the rev on everything in the crossgdb portgroup?)

Right, since this changes the files that get installed, the revisions must be increased.

Replying to pmetzger:

build /opt/local/var/macports/build/arm-none-eabi-gdb-5f0004ef/work/gdb-13.1/gdb/../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 15] for the enumeration type 'ui_out_flag' [-Wenum-constexpr-conversion]

This is the bug report for that: https://sourceware.org/bugzilla/show_bug.cgi?id=31331

And the fix: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=4a0b2cb7210c65c8c9f4a56345749bb7294fbfbf

comment:7 Changed 7 months ago by pmetzger (Perry E. Metzger)

What about adding the port:zlib library dependency? Should that also be done by the portgroup?

I thought it already was being done, but if not, yes, it needs to be done by the portgroup because zlib is now required.

This is the bug report for that

So presumably what we want to do is update to the current gdb? We're way behind anyway.

comment:8 Changed 7 months ago by pmetzger (Perry E. Metzger)

So I'm trying to update the port to the latest GDB and I get the following problem now during the destroot phase, and I can't make heads or tails of it:

:debug:destroot Executing proc-post-org.macports.destroot-destroot-0
:error:destroot Failed to destroot arm-none-eabi-gdb: error renaming "/opt/local/var/macports/build/arm-none-eabi-gdb-e5e9f805/work/destroot/opt/local/include/sim": no such file or directory
:debug:destroot Error code: NONE
:debug:destroot Backtrace: error renaming "/opt/local/var/macports/build/arm-none-eabi-gdb-e5e9f805/work/destroot/opt/local/include/sim": no such file or directory
:debug:destroot     while executing
:debug:destroot "$post $targetname"

Can you help?

comment:9 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

The post-destroot block in the portgroup that tries to move the sim directory is failing because the sim directory doesn't exist.

https://github.com/macports/macports-ports/blob/ad65db7c8b795576f142fb3864241a76747fdc15/_resources/port1.0/group/crossgdb-1.0.tcl#L177-L178

comment:10 Changed 7 months ago by pmetzger (Perry E. Metzger)

Okay, so, should I alter the portgroup not to complain if that directory is missing, or would you recommend some other action?

comment:11 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

I'm not familiar with building gdb, what that directory is, why it might be missing, or if that's ok.

comment:12 Changed 6 months ago by DanielO (Daniel O'Connor)

This appears to be fixed now - I have successfully built gdb after updating the ports tree.

Note: See TracTickets for help on using tickets.