Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10.3 FTBFS #12

Closed
jengelh opened this issue Aug 15, 2021 · 11 comments
Closed

10.3 FTBFS #12

jengelh opened this issue Aug 15, 2021 · 11 comments

Comments

@jengelh
Copy link
Contributor

jengelh commented Aug 15, 2021

[   22s] gcc -DHAVE_CONFIG_H -I.  -I../lib -I../lib -I/include   -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g  -Wcast-align -Wconversion -Wextra -Wfloat-equal -Wimplicit-fallthrough -Wredundant-decls -Wshadow -Wsign-compare -Wsign-conversion -Wuninitialized -Wunreachable-code -Wunused -Wwrite-strings -c -o lexer.o lexer.c
[   22s] In file included from lexer.c:18:
[   22s] ../lib/string.h:959:1: error: expected ',' or ';' before '_GL_ATTRIBUTE_MALLOC'
[   22s]   959 | _GL_FUNCDECL_SYS (strdup, char *,
[   22s]       | ^~~~~~~~~~~~~~~~

https://build.opensuse.org/package/live_build_log/devel:tools/cdecl/openSUSE_Tumbleweed/x86_64

gcc -E has to say

extern int _gl_cxxalias_dummy;
# 959 "../lib/string.h" 3
extern char * strdup (char const *__s) __attribute__ ((__nonnull__ (1))) _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
@paul-j-lucas
Copy link
Owner

This looks to be a problem with the upstream GnuLib since I'm not the author of lib/string.h. I've test compiled this on a few Linux x86_64 platforms, FreeBSD, Solaris (Sparc, AMD, and Intel), and macOS (Intel and M1) and all compile just fine. I don't have access to any OpenSuse Linux platforms to build.

@jengelh
Copy link
Contributor Author

jengelh commented Aug 15, 2021

Both src/lexer.c and lib/string.h have no #include "config.h", so they do not know the definition of _GL_ATTRIBUTE_MALLOC.
lib/string.h happens to redefine _GL_ATTRIBUTE_PURE on its own, which is why it only fails from the strdup line onwards, and not with any of the prior prototypes.

@paul-j-lucas
Copy link
Owner

lexer.l has #include "pjl_config.h" as the very first #include since cdecl's code always uses pjl_config.h (for reasons explained in its comments) and not config.h directly.

@jengelh
Copy link
Contributor Author

jengelh commented Aug 15, 2021

#  if (!1 || __GNUC__ >= 11) && !defined strdup
_GL_FUNCDECL_SYS (strdup, char *,
                  (char const *__s)
                  _GL_ARG_NONNULL ((1))
                  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
#  endif

Tumbleweed uses gcc 11, which is why it only fails on that version of SUSE. (The older releases have gcc7.)

@paul-j-lucas
Copy link
Owner

paul-j-lucas commented Aug 15, 2021

It's still looking like an issue with the upstream GnuLib and not cdecl. The GnuLib maintainers occasionally break things.

@paul-j-lucas
Copy link
Owner

Were you going to raise the issue with GnuLib?

@jengelh
Copy link
Contributor Author

jengelh commented Aug 16, 2021

I determined the author of the lines that cause me this trible (@bhaible) and sent a private mail now.

@paul-j-lucas
Copy link
Owner

If you could keep me posted, perhaps paste a link to a created issue, then I'd know when the upstream issue is fixed so I could update the copy of GnuLib inside cdecl, that would be good.

@bhaible
Copy link

bhaible commented Aug 22, 2021

@paul-j-lucas
Copy link
Owner

I've pulld from GnuLib, updated cdecl, and pushd to master. Try building master. Since it's not a released build, you'll need to run bootstrap manually to generate configure. Let me know if it's fixed.

@paul-j-lucas
Copy link
Owner

Confirmed as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants