Opened 3 months ago

Closed 3 months ago

#70869 closed defect (fixed)

gss @1.0.4: config.h:1001:37: an attribute list cannot appear here

Reported by: ShadSterling (Shad Sterling) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.10.1
Keywords: sequoia Cc: ryandesign (Ryan Carsten Schmidt)
Port: gss gettext

Description

2018 Intel macbook just upgraded to Sequoia, sudo port migrate largely failed on #70750 and then #70849, after addressing those sudo port restore --last also largely fails due to this error building gss:

:info:build libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch x86_64 -MT libgnu_la-fd-hook.lo -MD -MP -MF .deps/libgnu_la-fd-hook.Tpo -c fd-hook.c -o libgnu_la-fd-hook.o >/dev/null 2>&1
:info:build In file included from ialloc.c:21:
:info:build ./ialloc.h:39:1: error: an attribute list cannot appear here
:info:build    39 | IALLOC_INLINE void * _GL_ATTRIBUTE_COLD
:info:build       | ^~~~~~~~~~~~~
:info:build ialloc.c:20:23: note: expanded from macro 'IALLOC_INLINE'
:info:build    20 | #define IALLOC_INLINE _GL_EXTERN_INLINE
:info:build       |                       ^~~~~~~~~~~~~~~~~
:info:build ../../config.h:1193:35: note: expanded from macro '_GL_EXTERN_INLINE'
:info:build  1193 | # define _GL_EXTERN_INLINE static _GL_UNUSED
:info:build       |                                   ^~~~~~~~~~
:info:build ../../config.h:1006:20libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch x86_64 -MT libgnu_la-getprogname.lo -MD -MP -MF .deps/libgnu_la-getprogname.Tpo -c getprogname.c -o libgnu_la-getprogname.o >/dev/null 2>&1
:info:build : note: expanded from macro '_GL_UNUSED'
:info:build  1006 | #define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
:info:build       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build ../../config.h:1001:37: note: expanded from macro '_GL_ATTRIBUTE_MAYBE_UNUSED'
:info:build  1001 | # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
:info:build       |                                     ^~~~~~~~~~~~~~~~~~~~

Attachments (3)

main.log (276.2 KB) - added by ShadSterling (Shad Sterling) 3 months ago.
gss-glib-patch-1.diff (450 bytes) - added by kencu (Ken) 3 months ago.
gss-glib-patch-2.diff (476 bytes) - added by kencu (Ken) 3 months ago.

Download all attachments as: .zip

Change History (14)

Changed 3 months ago by ShadSterling (Shad Sterling)

Attachment: main.log added

comment:1 Changed 3 months ago by kencu (Ken)

It looks to me like the gnulib included in gss needs updating. The version is several years old.

I tried to do that, but my gnulib skills are not up to snuff. Even after updating gnulib and adding the additional macros to configure.ac that seemed to be needed, I still got these errors about an attribute list cannot appear here.

A brute-force method did work for me:

% port -v installed gss
The following ports are currently installed:
  gss @1.0.4_0 (active) requested_variants='' platform='darwin 24' archs='arm64' date='2024-09-22T16:25:19-0700'

and passes all tests:

/Library/Developer/CommandLineTools/usr/bin/make  check-TESTS
PASS: threadsafety.sh
PASS: basic
PASS: saslname
============================================================================
Testsuite summary for GNU Generic Security Service 1.0.4
============================================================================
# TOTAL: 3
# PASS:  3
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

but it's not pretty. I will attach the (simple) patches I used.

Clearly, upstream gss needs to fix this, and maybe upstream gnulib as well.

Last edited 3 months ago by kencu (Ken) (previous) (diff)

Changed 3 months ago by kencu (Ken)

Attachment: gss-glib-patch-1.diff added

Changed 3 months ago by kencu (Ken)

Attachment: gss-glib-patch-2.diff added

comment:2 Changed 3 months ago by kencu (Ken)

I'm not going to push these patches to MacPorts as they are too brute force and obtuse. Use them if you wish, while you / we see how this plays out properly once upstream gets involved.

Someone needs to open up an upstream ticket in gss and/or gnulib about this.

Last edited 3 months ago by kencu (Ken) (previous) (diff)

comment:3 Changed 3 months ago by kencu (Ken)

I remember now reading about how clang will reject attribute lists that come before the function declaration, but gcc accepts them.

eg: https://github.com/llvm/llvm-project/issues/58229

So gnulib may need to reorder things.

comment:4 Changed 3 months ago by jmroot (Joshua Root)

Cc: ryandesign added
Port: gettext added

I tried patching extern-inline.m4, but it gets overwritten with the copy shipped with gettext when autopoint is run as part of autoreconf.

comment:5 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

I don't think I have anything to add to this ticket. It sounds like upstream code is wrong so an upstream bug report needs to be filed so the developers fix their code.

comment:6 Changed 3 months ago by jmroot (Joshua Root)

That is true, but "upstream" here is gnulib, and it could be quite a while before gettext adopts the updated gnulib and releases a new version and we update the gettext port.

comment:7 Changed 3 months ago by jmroot (Joshua Root)

The patch itself is relatively simple:

  • m4/extern-inline.m4

    old new  
    7171# define _GL_EXTERN_INLINE extern
    7272# define _GL_EXTERN_INLINE_IN_USE
    7373#else
    74 # define _GL_INLINE static _GL_UNUSED
    75 # define _GL_EXTERN_INLINE static _GL_UNUSED
     74# define _GL_INLINE _GL_UNUSED static
     75# define _GL_EXTERN_INLINE _GL_UNUSED static
    7676#endif
    7777
    7878/* In GCC 4.6 (inclusive) to 5.1 (exclusive),

It's just a matter of applying it in the right place, which AFAICT is gettext.

comment:8 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

I don't know anything about that patch. Can you provide the upstream URL where the developers say that is the correct fix?

comment:10 Changed 3 months ago by jmroot (Joshua Root)

OK, so it's a little more complicated than I realised. ${prefix}/share/gettext/archive.dir.tar.bz2 contains support files for a large number of older version of gettext, which get used based on the version passed to AM_GNU_GETTEXT_VERSION. I don't know if bug-for-bug compatibility with the older versions is the goal, or if a patch like this that fixes some platforms and shouldn't break anything might be accepted.

In any case, it looks like the easier fix for gss would be to switch to AM_GNU_GETTEXT_REQUIRE_VERSION, which uses the latest available version >= the specified version, rather than using the exact version given.

comment:11 Changed 3 months ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 1b9e68ff81ce059d977317d704963385f60938ca/macports-ports (master):

gss: fix build with clang in C23 mode

Closes: #70869

Note: See TracTickets for help on using tickets.