Opened 4 years ago

Closed 4 years ago

#61558 closed defect (fixed)

man @1.6g_2: error: type name requires a specifier or qualifier

Reported by: GussyFinkNottle Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: catalina bigsur Cc: mascguy (Christopher Nielsen), rswail (Ron Wail)
Port: man

Description

The build appears to me to break here:

:info:build Creating man.1 from man.1.in
:info:build In file included from to_cat.c:2:
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdlib.h:66:
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/wait.h:109:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/signal.h:182:10: error: type name requires a specifier or qualifier
:info:build         uid_t   si_uid;                 /* sender's ruid */
:info:build                 ^
:info:build In file included from glob.c:63:
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdlib.h:66:
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/wait.h:109:

There are other errors in the log. The build also fails if I specify (+xcode, which is installed at version 12.2).

Attachments (1)

main.log (104.1 KB) - added by GussyFinkNottle 4 years ago.
build log file generated by: sudo port clean man ; sudo port install man -xcode

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by GussyFinkNottle

Attachment: main.log added

build log file generated by: sudo port clean man ; sudo port install man -xcode

comment:1 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

I imagine Apple will eventually publish patches for this at opensource.apple.com, although MacPorts can probably fix this much sooner.

comment:2 Changed 4 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:3 Changed 4 years ago by mascguy (Christopher Nielsen)

This failure also occurs with Xcode 12.0.

comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign rswail added; ryandesign@… removed
Keywords: catalina bigsur added
Summary: man @1.6g_2 (-xcode) fails to build on Catalina 10.15.7 using CLT 12.2 (12B45g)man @1.6g_2: error: type name requires a specifier or qualifier

comment:5 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign removed
Owner: set to ryandesign
Status: newaccepted

Like #61446 this is also due to implicit function declarations, but this time in the configure script.

I'm using MacPorts base master (2.6.99) which includes additional code to look for signs of implicit function declarations in the config.log and print them out. Unfortunately, man doesn't use an autoconf-based configure script. It uses a hand-made configure script, one which does not write a config.log or provide a way to see any errors encountered in the configuration tests, which is why this additional MacPorts base code didn't show any signs of the problem.

Since the build error mentioned uid_t, this output from the configure script caught my eye:

checking whether sys/types.h defines uid_t
awk: can't open file /usr/include/pwd.h
 source line number 1

What's happening is that it's trying to compile a test program to determine if uid_t is defined. It fails to compile due to implicit function declarations. It then tries a second way of determining what type to use instead of uid_t: it tries to parse the /usr/include/pwd.h header directly. Headers aren't in /usr/include on Mojave or later, so this too fails, but the configure script does not contain any error checking that would notice this, assumes it has succeeded, and adds command line macros which effectively replace all occurrences of uid_t (and gid_t) with whatever was found in the file -- in this case nothing. We see -Duid_t= -Dgid_t= in the compile lines in the build phase. This leads to the build error since the compiler now thinks we're trying to use si_uid as the type name, and that isn't a type name.

This is probably not the only configure test that is failing due to implicit function declarations, so rather than just fix this one, I will try to modify the configure script to write a minimal config.log or at least output its errors so that I can see and fix all of the problems.

comment:6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 2e94e2f4039bffbf7ef91c3d97e3f70b67c7cdb6/macports-ports (master):

man: Fix implicit declaration of exit in configure

Fix implicit declaration of library function exit in configure script
which led to build failure with Xcode 12.

Modify configure script to write a minimal config.log so that future
configure test failures are easier to notice and diagnose.

Closes: #61558

Use MacPorts CFLAGS, CPPFLAGS, and LDFLAGS when running configure tests.

Also use MacPorts CPPFLAGS when building.

Rename some patchfiles.

Note: See TracTickets for help on using tickets.