Skip to content

Conversation

@khwilliamson
Copy link
Contributor

Under some configurations the three declarations here warned; the #ifdef was missing a term

Under some configurations the three declarations here warned; the #ifdef
was missing a term
@jkeenan
Copy link
Contributor

jkeenan commented Jan 27, 2024

Under some configurations the three declarations here warned; the #ifdef was missing a term

Can you specify what one of those configurations was so that we could attempt to reproduce the warnings?

@khwilliamson
Copy link
Contributor Author

One of the many is -Accflags=-DNO_LOCALE_MESSAGES

@jkeenan
Copy link
Contributor

jkeenan commented Jan 28, 2024

-Accflags=-DNO_LOCALE_MESSAGES

As in #21895 (comment), I'm getting a build-time error when I invoke what I understand to be your recommended configuration invocation.

$ gitcurr;git describe
blead
v5.39.7-32-gaf9733f1e2

$ sh ./Configure -des -Dusedevel -Accflags=-DNO_LOCALE_MESSAGES && make test_prep
...
cc -fstack-protector-strong -L/usr/local/lib -o miniperl \
    opmini.o perlmini.o universalmini.o av.o builtin.o caretx.o class.o deb.o doio.o doop.o dquote.o dump.o globals.o gv.o hv.o keywords.o locale.o mathoms.o mg.o mro_core.o numeric.o pad.o peep.o perlio.o perly.o pp.o pp_ctl.o pp_hot.o pp_pack.o pp_sort.o pp_sys.o reentr.o regcomp.o regcomp_debug.o regcomp_invlist.o regcomp_study.o regcomp_trie.o regexec.o run.o scope.o sv.o taint.o time64.o toke.o utf8.o util.o   miniperlmain.o  -lpthread -ldl -lm -lcrypt -lutil -lc 
/usr/bin/ld: locale.o: in function `S_langinfo_sv_i':
locale.c:(.text+0x1c7c): undefined reference to `emulate_langinfo'
collect2: error: ld returned 1 exit status
make: *** [makefile:390: lib/buildcustomize.pl] Error 1

@khwilliamson
Copy link
Contributor Author

It turns out there is a bug on non-Linux builds that needs to be fixed before this PR will work on those boxes. Am now smoking a fix

@jkeenan
Copy link
Contributor

jkeenan commented Jan 28, 2024

It turns out there is a bug on non-Linux builds that needs to be fixed before this PR will work on those boxes. Am now smoking a fix

I tested this on Linux.

$ uname -mrs
Linux 6.5.0-14-generic x86_64

@khwilliamson
Copy link
Contributor Author

Sorry. I don't know why this was working for me and not you. I believe that with #21903 applied, this should work.

@jkeenan
Copy link
Contributor

jkeenan commented Jan 29, 2024

Sorry. I don't know why this was working for me and not you. I believe that with #21903 applied, this should work.

Unfortunately, I am still unable to build the base case with which this p.r. needs to be compared.

$ uname -mrs
Linux 6.5.0-14-generic x86_64
$ gitcurr
blead
$ git describe
v5.39.7-52-g36e39d6e1c
$ sh ./Configure -des -Dusedevel -Accflags=-DNO_LOCALE_MESSAGES && make test_prep
...
cc -fstack-protector-strong -L/usr/local/lib -o miniperl \
    opmini.o perlmini.o universalmini.o av.o builtin.o caretx.o class.o deb.o doio.o doop.o dquote.o dump.o globals.o gv.o hv.o keywords.o locale.o mathoms.o mg.o mro_core.o numeric.o pad.o peep.o perlio.o perly.o pp.o pp_ctl.o pp_hot.o pp_pack.o pp_sort.o pp_sys.o reentr.o regcomp.o regcomp_debug.o regcomp_invlist.o regcomp_study.o regcomp_trie.o regexec.o run.o scope.o sv.o taint.o time64.o toke.o utf8.o util.o   miniperlmain.o  -lpthread -ldl -lm -lcrypt -lutil -lc 
/usr/bin/ld: locale.o: in function `S_langinfo_sv_i':
locale.c:(.text+0x1c7c): undefined reference to `emulate_langinfo'
collect2: error: ld returned 1 exit status
make: *** [makefile:390: lib/buildcustomize.pl] Error 1

I got the same build failure on a different Linux (Debian bullseye, rather than Ubuntu 22.04 LTS).

[bullseye:perl] 2004 $ uname -mrs
Linux 5.10.0-25-amd64 x86_64
$ uname -a
Linux bullseye 5.10.0-25-amd64 #1 SMP Debian 5.10.191-1 (2023-08-16) x86_64 GNU/Linux
$ gitcurr
blead
$ git describe
v5.39.7-52-g36e39d6e1c
$ sh ./Configure -des -Dusedevel -Accflags=-DNO_LOCALE_MESSAGES && make test_prep 
...
cc -fstack-protector-strong -L/usr/local/lib -o miniperl \
    opmini.o perlmini.o universalmini.o av.o builtin.o caretx.o class.o deb.o doio.o doop.o dquote.o dump.o globals.o gv.o hv.o keywords.o locale.o mathoms.o mg.o mro_core.o numeric.o pad.o peep.o perlio.o perly.o pp.o pp_ctl.o pp_hot.o pp_pack.o pp_sort.o pp_sys.o reentr.o regcomp.o regcomp_debug.o regcomp_invlist.o regcomp_study.o regcomp_trie.o regexec.o run.o scope.o sv.o taint.o time64.o toke.o utf8.o util.o   miniperlmain.o  -lpthread -ldl -lm -lcrypt -lutil -lc 
/usr/bin/ld: locale.o: in function `S_langinfo_sv_i':
locale.c:(.text+0x1cdc): undefined reference to `emulate_langinfo'
collect2: error: ld returned 1 exit status
make: *** [makefile:390: lib/buildcustomize.pl] Error 1

But, weirdly, I was able to build successfully on FreeBSD!

$ uname -mrs
FreeBSD 13.2-RELEASE-p1 amd64
$ gitcurr; git describe
blead
v5.39.7-52-g36e39d6e1c
$ sh ./Configure -des -Dusedevel -Accflags=-DNO_LOCALE_MESSAGES && make test_prep
...
$ ./perl -Ilib -v | head -2 | tail -1; ./perl -Ilib -V:config_args
This is perl 5, version 39, subversion 8 (v5.39.8 (v5.39.7-52-g36e39d6e1c)) built for amd64-freebsd
config_args='-des -Dusedevel -Accflags=-DNO_LOCALE_MESSAGES';

Does anyone have any thoughts as to why this configuration is not building (for me) on Linux?

@jkeenan
Copy link
Contributor

jkeenan commented Jan 29, 2024

Two additional notes: First, I should note that in the make test_prep output cited above on Linux, the build is failing at the point mentioned, but earlier in that command I am indeed getting two build-time warnings during make.

$ sh ./Configure -des -Dusedevel -Accflags=-DNO_LOCALE_MESSAGES && make test_prep
...
cc -c -DPERL_CORE -DNO_LOCALE_MESSAGES -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -
I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c99 -O2 -Wall -Werror=pointer-ar
ith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings
 locale.c
locale.c: In function ‘S_langinfo_sv_i’:
locale.c:6175:16: warning: implicit declaration of function ‘emulate_langinfo’ [-Wimplicit-function-
declaration]
 6175 |         return emulate_langinfo(item, locale, sv, utf8ness);
      |                ^~~~~~~~~~~~~~~~
locale.c:6175:16: warning: returning ‘int’ from a function with return type ‘const char *’ makes poi
nter from integer without a cast [-Wint-conversion]
 6175 |         return emulate_langinfo(item, locale, sv, utf8ness);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Were those the build-time warnings which this p.r. is trying to address?

Second, the first (Ubuntu) Linux build-time failure I reported used gcc-11 as the C-compiler. On the same machine I tried to compile with clang-14 and got what appears to be the same failure.

$ sh ./Configure -des -Dusedevel -Dcc=clang-14 -Accflags=-DNO_LOCALE_MESSAGES && make test_prep 
...
clang-14 -fstack-protector-strong -L/usr/local/lib -o miniperl \
    opmini.o perlmini.o universalmini.o av.o builtin.o caretx.o class.o deb.o doio.o doop.o dquote.o dump.o globals.o gv.o hv.o keywords.o locale.o mathoms.o mg.o mro_core.o numeric.o pad.o peep.o perlio.o perly.o pp.o pp_ctl.o pp_hot.o pp_pack.o pp_sort.o pp_sys.o reentr.o regcomp.o regcomp_debug.o regcomp_invlist.o regcomp_study.o regcomp_trie.o regexec.o run.o scope.o sv.o taint.o time64.o toke.o utf8.o util.o   miniperlmain.o  -lpthread -ldl -lm -lcrypt -lutil -lc 
/usr/bin/ld: locale.o: in function `S_langinfo_sv_i':
locale.c:(.text+0x5745): undefined reference to `emulate_langinfo'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [makefile:390: lib/buildcustomize.pl] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants