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

net-nds/ldapvi: Fix call to undeclared function on_exit #31513

Closed
wants to merge 1 commit into from

Conversation

listout
Copy link
Contributor

@listout listout commented Jun 17, 2023

@gentoo-bot
Copy link

Pull Request assignment

Submitter: @listout
Areas affected: ebuilds
Packages affected: net-nds/ldapvi

net-nds/ldapvi: @gentoo/proxy-maint (maintainer needed)

Linked bugs

Bugs linked: 898066


In order to force reassignment and/or bug reference scan, please append [please reassign] to the pull request title.

Docs: Code of ConductCopyright policy (expl.) ● DevmanualGitHub PRsProxy-maint guide

@gentoo-bot gentoo-bot added maintainer-needed There is at least one affected package with no maintainer. Review it if you can. assigned PR successfully assigned to the package maintainer(s). bug linked Bug/Closes found in footer, and cross-linked with the PR. labels Jun 17, 2023
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-06-17 16:25 UTC
Newest commit scanned: ccc33f1
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/9701d2a62a/output.html

Copy link
Member

@juippis juippis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm! Can't compile this with clang-16. gcc-13 works fine.

>>> Compiling source in /var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi ...
make -j32 
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o ldapvi.o ldapvi.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o data.o data.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o diff.o diff.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o error.o error.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o misc.o misc.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o parse.o parse.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o port.o port.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o print.o print.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o search.o search.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o base64.o base64.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o arguments.o arguments.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o parseldif.o parseldif.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o sasl.o sasl.c
arguments.c:191:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute
      [-Wunused-result]
                write(fd, USAGE, strlen(USAGE));
                ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
arguments.c:567:4: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                        else if (strcmp(value, "yes")) {
                        ^
sasl.c:79:2: warning: SASL support disabled [-W#warnings]
#warning SASL support disabled
 ^
parse.c:39:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support implicit function
      declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parse.c:64:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support implicit functionparseldif.c:43:16: 
error: 1      declarations warning [-Wimplicit-function-declaration] generated.
call 
to undeclared function 'getc_unlocked'; ISO C99 and later do not support implicit
      function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
                switch ( c = getc_unlocked(s)) {
                             ^
parse.c:89:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support implicit function
      parseldif.c:80:declarations16:  [-Wimplicit-function-declaration]error: call
 to undeclared function 'getc_unlocked'; ISO C99 and later do not support implicit
      function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
                switch ( c = getc_unlocked(s)) {
                             ^
parseldif.c:113:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support implicit
      function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parseldif.c:214:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if ( c = ldif_read_ad(s, name)) return c;
             ~~^~~~~~~~~~~~~~~~~~~~~~~
parseldif.c:214:9: note: place parentheses around the assignment to silence this warning
        if ( c = ldif_read_ad(s, name)) return c;
               ^
             (                        )
parseldif.c:214:9: note: use '==' to turn this assignment into an equality comparison
        if ( c = ldif_read_ad(s, name)) return c;
               ^
               ==
parse.c:224:16: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if ( encoding = memchr(name->str, ':', name->len)) {
             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
parse.c:224:16: note: place parentheses around the assignment to silence this warning
        if ( encoding = memchr(name->str, ':', name->len)) {
                      ^
             (                                           )
parse.c:224:16: note: use '==' to turn this assignment into an equality comparison
        if ( encoding = memchr(name->str, ':', name->len)) {
                      ^
                      ==
1 warning and 3 errors generated.
1 warning and 3 errors generated.
make: *** [GNUmakefile:16: parse.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [GNUmakefile:16: parseldif.o] Error 1
ldapvi.c:579:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute
      [-Wunused-result]
        mkdtemp(dir);
        ^~~~~~~ ~~~
ldapvi.c:721:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if ( rc = ldap_initialize(&ld, server)) {
             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ldapvi.c:721:10: note: place parentheses around the assignment to silence this warning
        if ( rc = ldap_initialize(&ld, server)) {
                ^
             (                                )
ldapvi.c:721:10: note: use '==' to turn this assignment into an equality comparison
        if ( rc = ldap_initialize(&ld, server)) {
                ^
                ==
ldapvi.c:766:2: warning: Deprecated pre-processor symbol: replace with "g_string_append_printf" [-W#pragma-messages]
        g_string_sprintfa(name, "-%d.ldif", getpid());
        ^
/usr/include/glib-2.0/glib/gstring.h:290:51: note: expanded from macro 'g_string_sprintfa'
#define  g_string_sprintfa g_string_append_printf GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_string_append_printf)
                                                  ^
/usr/include/glib-2.0/glib/glib-visibility.h:40:46: note: expanded from macro 'GLIB_DEPRECATED_MACRO_IN_2_26_FOR'
#define GLIB_DEPRECATED_MACRO_IN_2_26_FOR(f) GLIB_DEPRECATED_MACRO_FOR (f)
                                             ^
/usr/include/glib-2.0/glib/gmacros.h:1299:3: note: expanded from macro 'GLIB_DEPRECATED_MACRO_FOR'
  _GLIB_GNUC_DO_PRAGMA(GCC warning G_STRINGIFY (Deprecated pre-processor symbol: replace with #f))
  ^
/usr/include/glib-2.0/glib/gmacros.h:1296:33: note: expanded from macro '_GLIB_GNUC_DO_PRAGMA'
#define _GLIB_GNUC_DO_PRAGMA(x) _Pragma(G_STRINGIFY (x))
                                ^
<scratch space>:66:6: note: expanded from here
 GCC warning "Deprecated pre-processor symbol: replace with \"g_string_append_printf\""
     ^
misc.c:403:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
                write(2, "\nmalloc error\n", sizeof("\nmalloc error\n") - 1);
                ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
misc.c:417:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
                write(2, "\nstrdup error\n", sizeof("\nstrdup error\n") - 1);
                ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
port.c:134:20: warning: passing 'char[4]' to parameter ofldapvi.c: 1221type: 3: warning: 'unsigned char *'add explicit  bracesconverts  tobetween  avoid dangling pointerselse to integer 
      types[-Wdangling-else]
 where                else
                ^
 one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        RAND_pseudo_bytes(rand, sizeof(rand));
                          ^~~~
/usr/include/openssl/rand.h:61:31: note: passing argument to parameter 'buf' here
int RAND_bytes(unsigned char *buf, int num);
                              ^
port.c:136:2: warning: 'SHA1_Init' is deprecated [-Wdeprecated-declarations]
        SHA1_Init(&SHA1context);
        ^
/usr/include/openssl/sha.h:49:1: note: 'SHA1_Init' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:137:2: warning: 'SHA1_Update' is deprecated [-Wdeprecated-declarations]
        SHA1_Update(&SHA1context, key, strlen(key));
        ^
/usr/include/openssl/sha.h:50:1: note: 'SHA1_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:138:2: warning: 'SHA1_Update' is deprecated [-Wdeprecated-declarations]
        SHA1_Update(&SHA1context, rand, sizeof(rand));
        ^
/usr/include/openssl/sha.h:50:1: note: 'SHA1_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:139:2: warning: 'SHA1_Final' is deprecated [-Wdeprecated-declarations]
        SHA1_Final(tmp, &SHA1context);
        ^
/usr/include/openssl/sha.h:51:1: note: 'SHA1_Final' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:154:2: warning: 'MD5' is deprecated [-Wdeprecated-declarations]
        MD5((unsigned char *) key, strlen(key), tmp);
        ^
/usr/include/openssl/md5.h:52:1: note: 'MD5' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:168:2: warning: 'MD5_Init' is deprecated [-Wdeprecated-declarations]
        MD5_Init(&MD5context);
        ^
/usr/include/openssl/md5.h:49:1: note: 'MD5_Init' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:169:2: warning: 'MD5_Update' is deprecated [-Wdeprecated-declarations]
        MD5_Update(&MD5context, key, strlen(key));
        ^
/usr/include/openssl/md5.h:50:1: note: 'MD5_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:170:2: warning: 'MD5_Update' is deprecated [-Wdeprecated-declarations]
        MD5_Update(&MD5context, rand, sizeof(rand));
        ^
/usr/include/openssl/md5.h:50:1: note: 'MD5_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:171:2: warning: 'MD5_Final' is deprecated [-Wdeprecated-declarations]
        MD5_Final(tmp, &MD5context);
        ^
/usr/include/openssl/md5.h:51:1: note: 'MD5_Final' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
10 warnings generated.
2 warnings generated.
2 warnings generated.
4 warnings generated.
 * ERROR: net-nds/ldapvi-1.7_p20101214-r5::gentoo failed (compile phase):

This seems to be the culprit though:

error: 1      declarations warning [-Wimplicit-function-declaration] generated.

@listout
Copy link
Contributor Author

listout commented Jul 14, 2023

Lemme see

@listout
Copy link
Contributor Author

listout commented Jul 14, 2023

@juippis how are you building (any specific use flags or something)?

because I'm getting: http://ix.io/4AAj


However I do an error in the install phase:

>>> Install net-nds/ldapvi-1.7_p20101214-r5 into /var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/image
install: cannot change ownership of '/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/image/usr/bin/ldapvi': Operation not permitted
 * ERROR: net-nds/ldapvi-1.7_p20101214-r5::gentoo failed (install phase):
 *   dobin failed
 *
 * If you need support, post the output of `emerge --info '=net-nds/ldapvi-1.7_p20101214-r5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-nds/ldapvi-1.7_p20101214-r5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/temp/environment'.
 * Working directory: '/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi'
 * S: '/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi'

But that might be unrelated

@juippis
Copy link
Member

juippis commented Jul 15, 2023

You can see my cflags from the post above, nothing weird, only -march=native -O2 -pipe -frecord-gcc-switches.
https://wiki.gentoo.org/wiki/Package_testing these are the settings I use

One weird thing I discovered is that this works on musl-clang:16, but not on normal system with clang:16. GCC-13 works fine with both.

@thesamesam ideas about the error?

@listout
Copy link
Contributor Author

listout commented Jul 15, 2023

Huh, that weird. I need setup a llvm-glibc testing environment as well

@listout
Copy link
Contributor Author

listout commented Jul 15, 2023

@juippis can you add #include <stdio.h> in the parser.c file and see if the error persists?

@listout
Copy link
Contributor Author

listout commented Jul 15, 2023

I'm trying something, I'll force push in a moment

@listout
Copy link
Contributor Author

listout commented Jul 15, 2023

@juippis can you please try now

Copy link
Member

@juippis juippis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still no, although the error with parse.c seems to be resolved, now I get a similar error with parseldif.c:

parseldif.c:43:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parseldif.c:80:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parseldif.c:113:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parseldif.c:214:9: warning: using the result of an assignment as a condition without parentheses
      [-Wparentheses]
        if ( c = ldif_read_ad(s, name)) return c;
             ~~^~~~~~~~~~~~~~~~~~~~~~~
parseldif.c:214:9: note: place parentheses around the assignment to silence this warning
        if ( c = ldif_read_ad(s, name)) return c;
               ^
             (                        )
parseldif.c:214:9: note: use '==' to turn this assignment into an equality comparison
        if ( c = ldif_read_ad(s, name)) return c;
               ^
               ==
1 warning and 3 errors generated.
make: *** [GNUmakefile:16: parseldif.o] Error 1
make: *** Waiting for unfinished jobs....

So progress I guess :)

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-07-15 07:45 UTC
Newest commit scanned: 524721b
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/04d4cb79f1/output.html

@listout listout force-pushed the ldapvi-musl-on_exit branch 2 times, most recently from 8631942 to da3ea6d Compare July 15, 2023 07:48
@listout
Copy link
Contributor Author

listout commented Jul 15, 2023

I did add #include <stdio.h> to files calling the getc_unlocked function. Weirdly I can't reproduce the issue on my glibc-clang16 system too.

Build log: http://sprunge.us/qcZeVJ

Very weird

@juippis
Copy link
Member

juippis commented Jul 15, 2023

I may have gotten too eager, I do see the error again in parse.c and parseldif.c, just it was now way after.

>>> Failed to emerge net-nds/ldapvi-1.7_p20101214-r5, Log file:
>>>  '/var/tmp/portage/vbslogs/build/net-nds/ldapvi-1.7_p20101214-r5:20230715-080922.log'
>>> Jobs: 0 of 1 complete, 1 failed                 Load avg: 0.08, 0.02, 0.01
 * Package:    net-nds/ldapvi-1.7_p20101214-r5:0
 * Repository: gentoo
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox

>>> Unpacking source...
>>> Unpacking ldapvi-1.7_p20101214.tar.bz2 to /var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work
>>> Source unpacked in /var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work
>>> Preparing source in /var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi ...
 * Applying ldapvi-1.7-fix-implicit-function-declarations.patch ...
 [ ok ]
 * Applying ldapvi-1.7-fix-missing-on_exit-musl.patch ...
 [ ok ]
 * Running eautoreconf in '/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi' ...
 * Running 'aclocal --system-acdir=/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/temp/aclocal' ...
 [ ok ]
 * Moving configure.in to configure.ac (bug #426262)
 * Running 'autoconf --force' ...
 [ ok ]
 * Running 'autoheader' ...
 [ !! ]
 * Running elibtoolize in: ldapvi-1.7_p20101214/ldapvi/
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi ...
 * econf: updating ldapvi-1.7_p20101214/ldapvi/config.sub with /usr/share/gnuconfig/config.sub
 * econf: updating ldapvi-1.7_p20101214/ldapvi/config.guess with /usr/share/gnuconfig/config.guess
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --datarootdir=/usr/share --docdir=/usr/share/doc/ldapvi-1.7_p20101214-r5 --htmldir=/usr/share/doc/ldapvi-1.7_p20101214-r5/html --libdir=/usr/lib64 --with-libcrypto=openssl
checking for a BSD-compatible install... /usr/lib/portage/python3.12/ebuild-helpers/xattr/install -c
checking for x86_64-pc-linux-gnu-gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether clang accepts -g... yes
checking for clang option to enable C11 features... none needed
checking for mkdtemp... yes
checking for on_exit... yes
checking for main in -lsocket... no
checking for main in -lresolv... yes
checking for main in -llber... yes
checking for main in -lldap... yes
checking for ldap_initialize in -lldap... yes
checking for ldap_bv2dn_x in -lldap... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sasl/sasl.h... no
configure: WARNING: SASL support disabled
checking for library containing tigetstr... -ltinfo
checking for curses.h... yes
checking for poptGetContext in -lpopt... yes
checking for readline in -lreadline... yes
checking for pkg-config... /usr/bin/pkg-config
checking for main in -lglib-2.0... yes
checking for main in -lssl... yes
checking for SHA1... yes
checking for RAND_pseudo_bytes... yes
checking for main in -lcrypt... yes
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: WARNING:  'GNUmakefile.in' seems to ignore the --datarootdir setting
config.status: creating config.h
>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi ...
make -j32 
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o ldapvi.o ldapvi.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o data.o data.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o diff.o diff.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o error.o error.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o misc.o misc.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o parse.o parse.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o port.o port.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o print.o print.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o search.o search.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o base64.o base64.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o arguments.o arguments.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o parseldif.o parseldif.c
clang -c -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native -O2 -pipe -frecord-gcc-switches -o sasl.o sasl.c
parse.c:40:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parse.c:65:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parse.c:90:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parseldif.c:44:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parseldif.c:81:16: error: call toparse.c :225:16: warning: using theundeclared function result of  an'getc_unlocked';  assignmentISO  asC99  a condition without parentheses
      [-Wparentheses]and
 later do not support
      implicit        if ( encoding = memchr(name->str, ':', name->len)) { 
function              ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~declarations
 [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parse.c:225:16: note: place parentheses around the assignment to silence this warning
        if ( encoding = memchr(name->str, ':', name->len)) {
                      ^
             (                                           )
parse.c:225:16: note: use '==' to turn this assignment into an equality comparison
        if ( encoding = memchr(name->str, ':', name->len)) {
                      ^
                      ==
parseldif.c:114:16: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
                switch ( c = getc_unlocked(s)) {
                             ^
parseldif.c:215:9: warning: using the result of an assignment as a condition without parentheses
      [-Wparentheses]
        if ( c = ldif_read_ad(s, name)) return c;
             ~~^~~~~~~~~~~~~~~~~~~~~~~
parseldif.c:215:9: note: place parentheses around the assignment to silence this warning
        if ( c = ldif_read_ad(s, name)) return c;
               ^
             (                        )
parseldif.c:215:9: note: use '==' to turn this assignment into an equality comparison
        if ( c = ldif_read_ad(s, name)) return c;
               ^
               ==
1 warning and 3 errors generated.
1 warning and 3 errors generated.
make: *** [GNUmakefile:16: parse.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [GNUmakefile:16: parseldif.o] Error 1
arguments.c:191:3: warning: ignoring return value of function declared with 'warn_unused_result'
      attribute [-Wunused-result]
                write(fd, USAGE, strlen(USAGE));
                ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
arguments.c:567:4: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                        else if (strcmp(value, "yes")) {
                        ^
sasl.c:79:2: warning: SASL support disabled [-W#warnings]
#warning SASL support disabled
 ^
ldapvi.c:580:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute
      [-Wunused-result]
        mkdtemp(dir);
        ^~~~~~~ ~~~
ldapvi.c:722:10: warning: using the result of an assignment as a condition without parentheses
      [-Wparentheses]
        if ( rc = ldap_initialize(&ld, server)) {
             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ldapvi.c:722:10: note: place parentheses around the assignment to silence this warning
        if ( rc = ldap_initialize(&ld, server)) {
                ^
             (                                )
ldapvi.c:722:10: note: use '==' to turn this assignment into an equality comparison
        if ( rc = ldap_initialize(&ld, server)) {
                ^
                ==
ldapvi.c:767:2: warning: Deprecated pre-processor symbol: replace with "g_string_append_printf"
      [-W#pragma-messages]
        g_string_sprintfa(name, "-%d.ldif", getpid());
        ^
/usr/include/glib-2.0/glib/gstring.h:290:51: note: expanded from macro 'g_string_sprintfa'
#define  g_string_sprintfa g_string_append_printf GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_string_append_printf)
                                                  ^
/usr/include/glib-2.0/glib/glib-visibility.h:40:46: note: expanded from macro
      'GLIB_DEPRECATED_MACRO_IN_2_26_FOR'
#define GLIB_DEPRECATED_MACRO_IN_2_26_FOR(f) GLIB_DEPRECATED_MACRO_FOR (f)
                                             ^
/usr/include/glib-2.0/glib/gmacros.h:1299:3: note: expanded from macro 'GLIB_DEPRECATED_MACRO_FOR'
  _GLIB_GNUC_DO_PRAGMA(GCC warning G_STRINGIFY (Deprecated pre-processor symbol: replace with #f))
  ^
/usr/include/glib-2.0/glib/gmacros.h:1296:33: note: expanded from macro '_GLIB_GNUC_DO_PRAGMA'
#define _GLIB_GNUC_DO_PRAGMA(x) _Pragma(G_STRINGIFY (x))
                                ^
<scratch space>:66:6: note: expanded from here
 GCC warning "Deprecated pre-processor symbol: replace with \"g_string_append_printf\""
     ^
misc.c:404:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute
      [-Wunused-result]
                write(2, "\nmalloc error\n", sizeof("\nmalloc error\n") - 1);
                ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
misc.c:418:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute
      [-Wunused-result]
                write(2, "\nstrdup error\n", sizeof("\nstrdup error\n") - 1);
                ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
ldapvi.c:1222:3: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                else
                ^
port.c:134:20: warning: passing 'char[4]' to parameter of type 'unsigned char *' converts between
      pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        RAND_pseudo_bytes(rand, sizeof(rand));
                          ^~~~
/usr/include/openssl/rand.h:61:31: note: passing argument to parameter 'buf' here
int RAND_bytes(unsigned char *buf, int num);
                              ^
port.c:136:2: warning: 'SHA1_Init' is deprecated [-Wdeprecated-declarations]
        SHA1_Init(&SHA1context);
        ^
/usr/include/openssl/sha.h:49:1: note: 'SHA1_Init' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:137:2: warning: 'SHA1_Update' is deprecated [-Wdeprecated-declarations]
        SHA1_Update(&SHA1context, key, strlen(key));
        ^
/usr/include/openssl/sha.h:50:1: note: 'SHA1_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:138:2: warning: 'SHA1_Update' is deprecated [-Wdeprecated-declarations]
        SHA1_Update(&SHA1context, rand, sizeof(rand));
        ^
/usr/include/openssl/sha.h:50:1: note: 'SHA1_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:139:2: warning: 'SHA1_Final' is deprecated [-Wdeprecated-declarations]
        SHA1_Final(tmp, &SHA1context);
        ^
/usr/include/openssl/sha.h:51:1: note: 'SHA1_Final' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int SHA1_Final(unsigned char *md, SHA_CTX *c);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:154:2: warning: 'MD5' is deprecated [-Wdeprecated-declarations]
        MD5((unsigned char *) key, strlen(key), tmp);
        ^
/usr/include/openssl/md5.h:52:1: note: 'MD5' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:168:2: warning: 'MD5_Init' is deprecated [-Wdeprecated-declarations]
        MD5_Init(&MD5context);
        ^
/usr/include/openssl/md5.h:49:1: note: 'MD5_Init' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:169:2: warning: 'MD5_Update' is deprecated [-Wdeprecated-declarations]
        MD5_Update(&MD5context, key, strlen(key));
        ^
/usr/include/openssl/md5.h:50:1: note: 'MD5_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:170:2: warning: 'MD5_Update' is deprecated [-Wdeprecated-declarations]
        MD5_Update(&MD5context, rand, sizeof(rand));
        ^
/usr/include/openssl/md5.h:50:1: note: 'MD5_Update' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
port.c:171:2: warning: 'MD5_Final' is deprecated [-Wdeprecated-declarations]
        MD5_Final(tmp, &MD5context);
        ^
/usr/include/openssl/md5.h:51:1: note: 'MD5_Final' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
^
/usr/include/openssl/macros.h:193:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^
/usr/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^
10 warnings generated.
2 warnings generated.
2 warnings generated.
4 warnings generated.
 * ERROR: net-nds/ldapvi-1.7_p20101214-r5::gentoo failed (compile phase):
 *   emake failed

@listout
Copy link
Contributor Author

listout commented Jul 15, 2023

Okay, I'm out of ideas here. I'll wait for Sam to shed some light on this one.

cc: @thesamesam

@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-07-15 08:15 UTC
Newest commit scanned: da3ea6d
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/d9f74d145e/output.html

@thesamesam
Copy link
Member

Let me take a look.

@thesamesam
Copy link
Member

thesamesam commented Jul 15, 2023

Checking man getc_unlocked, we see (sorry about the mangled formatting):

Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
getc_unlocked(), getchar_unlocked(), putc_unlocked(), putchar_unlocked():
/* glibc >= 2.24: / _POSIX_C_SOURCE >= 199309L
|| /
glibc <= 2.23: / _POSIX_C_SOURCE
|| /
glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE

glibc's default is not pure POSIX/ISO C, instead it sets _DEFAULT_SOURCE which exposes some GNU extensions (and POSIX extensions from later versions). If you set any *_SOURCE either as *FLAGS or in the source code, then it will take priority over _DEFAULT_SOURCE.

So, let's see..

$ grep -rsin "#define.*_SOURCE" /var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214
/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi/parseldif.c:18:#define _XOPEN_SOURCE
/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi/parse.c:18:#define _XOPEN_SOURCE
/var/tmp/portage/net-nds/ldapvi-1.7_p20101214-r5/work/ldapvi-1.7_p20101214/ldapvi/config.guess:711:             #define _HPUX_SOURCE

Uh oh!

The source is setting _XOPEN_SOURCE which ends up weaker than _DEFAULT_SOURCE, but it's not quite the right setting. Try #define _POSIX_C_SOURCE 200809L for modern POSIX, or you can try putting AC_USE_SYSTEM_EXTENSIONS in configure.ac (I prefer this in cases like this).

I would also check in this case what musl guards the getc_unlocked definition with (go check its headers), as the man page may or may not be wrong.

See also:

@juippis
Copy link
Member

juippis commented Aug 14, 2023

@listout before I forget, could you take a look given the awesome information sam gave?

@listout
Copy link
Contributor Author

listout commented Aug 14, 2023

Uhh ... yeah sure. But we continued this on IRC, I'll dig up the log. What's do you want me to take a look at. IIRC this something related to compiler-rt or something like that

Closes: https://bugs.gentoo.org/898066
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-09-30 17:45 UTC
Newest commit scanned: bcff66c
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/ce4f955d1e/output.html

@listout
Copy link
Contributor Author

listout commented Sep 30, 2023

@juippis ping :)

@gentoo-bot gentoo-bot closed this in 00a1ff4 Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned PR successfully assigned to the package maintainer(s). bug linked Bug/Closes found in footer, and cross-linked with the PR. maintainer-needed There is at least one affected package with no maintainer. Review it if you can.
Projects
None yet
5 participants