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

build-time failure on FreeBSD using clang++ and configuring with '-Duselongdouble' #17131

Closed
p5pRT opened this issue Aug 17, 2019 · 15 comments
Closed
Labels

Comments

@p5pRT
Copy link

p5pRT commented Aug 17, 2019

Migrated from rt.perl.org#134371 (status was 'pending release')

Searchable as RT134371$

@p5pRT
Copy link
Author

p5pRT commented Aug 17, 2019

From @jkeenan

When I attempt to build perl on FreeBSD using clang++ as the C-compiler
and adding '-Duselongdouble' to the configuration options, 'make' fails
at this relatively early point in the compilation process​:

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang -Duselongdouble
...
$ make
...
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith -Wextra
-Wc++-compat -Wwrite-strings perly.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated [-Wdeprecated]
@​

"make.freebsd11.clang++.longdouble.output.txt" 61L, 7089C
  1,1 Top
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
  SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
  ^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
  PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
  ^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
  ^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
  SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
  ^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
  PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
  ^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
  ^
2 errors generated.
*** Error code 1

Stop.
make​: stopped in /usr/home/jkeenan/gitwork/perl
#####

I first noticed this in smoke-test reports filed by Carlos Guevara
starting approximately 3 days ago. See, e.g.,
http​://perl5.test-smoke.org/report/93150. However, I suspect that the
clang++/uselongdouble combination was never tested on this OS until
then. Hence, I have no evidence that this is a regression whose
diagnosis could be pinpointed by bisection. Indeed, I checked out tags
5.22.0 and 5.26.0, tried to build perl on the same platform with clang++
and -Duselongdouble -- and got the same or very similar build-time
failures. I've gotten the build-time failure with clang++/uselongdouble
on both unthreaded and threaded builds.

By contrast, on this platform I *can* build perl 5 blead (a) with
g++/uselongdouble (albeit with some warnings in the same patch of code
as cited above); and with clang/uselongdouble.

Assuming this is not a regression, and given the obscurity of this
complier/config_args combination, I'm not overly concerned about this.
The "vendor perl" on FreeBSD is almost certainly built with clang -- not
clang++. I don't know enough about either clang++ or -Duselongdouble to
comment usefully further. But it would be good to at least diagnose the
problem.

Thank you very much.
Jim Keenan

perl perl perl

@p5pRT
Copy link
Author

p5pRT commented Aug 17, 2019

From @jkeenan

echo @​`sh cflags "optimize='-O2'" opmini.o` -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
@​clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
echo @​`sh cflags "optimize='-O2'" perlmini.o` -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
@​clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings gv.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings toke.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings perly.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings pad.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings regcomp.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings dump.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings util.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings mg.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings reentr.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings mro_core.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings keywords.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings hv.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings av.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings run.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings pp_hot.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings sv.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
  SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
  ^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
  PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
  ^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
  ^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
  SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
  ^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
  PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
  ^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
  ^
2 errors generated.
*** Error code 1

Stop.
make​: stopped in /usr/home/jkeenan/gitwork/perl

@p5pRT
Copy link
Author

p5pRT commented Aug 17, 2019

From @jkeenan

On Sat, 17 Aug 2019 22​:10​:38 GMT, jkeenan@​pobox.com wrote​:

When I attempt to build perl on FreeBSD using clang++ as the C-compiler
and adding '-Duselongdouble' to the configuration options, 'make' fails
at this relatively early point in the compilation process​:

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang -Duselongdouble
...
$ make
...
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith -Wextra
-Wc++-compat -Wwrite-strings perly.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated [-Wdeprecated]
@​

"make.freebsd11.clang++.longdouble.output.txt" 61L, 7089C
1,1 Top
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
2 errors generated.
*** Error code 1

Stop.
make​: stopped in /usr/home/jkeenan/gitwork/perl
#####

I first noticed this in smoke-test reports filed by Carlos Guevara
starting approximately 3 days ago. See, e.g.,
http​://perl5.test-smoke.org/report/93150. However, I suspect that the
clang++/uselongdouble combination was never tested on this OS until
then. Hence, I have no evidence that this is a regression whose
diagnosis could be pinpointed by bisection. Indeed, I checked out tags
5.22.0 and 5.26.0, tried to build perl on the same platform with clang++
and -Duselongdouble -- and got the same or very similar build-time
failures. I've gotten the build-time failure with clang++/uselongdouble
on both unthreaded and threaded builds.

By contrast, on this platform I *can* build perl 5 blead (a) with
g++/uselongdouble (albeit with some warnings in the same patch of code
as cited above); and with clang/uselongdouble.

Assuming this is not a regression, and given the obscurity of this
complier/config_args combination, I'm not overly concerned about this.
The "vendor perl" on FreeBSD is almost certainly built with clang -- not
clang++. I don't know enough about either clang++ or -Duselongdouble to
comment usefully further. But it would be good to at least diagnose the
problem.

The initial report usd clang++-6.

#####
$ clang++ --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
Target​: x86_64-unknown-freebsd11.2
Thread model​: posix
InstalledDir​: /usr/bin
#####

However, I get similar failures when using clang++-8.

#####
$ clang++80 --version
clang version 8.0.1 (tags/RELEASE_801/final)
Target​: x86_64-portbld-freebsd11.2
Thread model​: posix
InstalledDir​: /usr/local/llvm80/bin
#####

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang++80 -Duselongdouble && make test
...
clang++80 -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings sv.c
clang-8​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
  SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
  ^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
  PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
  ^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
  ^
sv.c​:12506​:41​: warning​: adding 'int' to a string does not append to the string [-Wstring-plus-int]
  && strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
  ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
./handy.h​:508​:37​: note​: expanded from macro 'strnEQ'
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
  ^~
sv.c​:12506​:41​: note​: use array indexing to silence this warning
  && strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
  ^
  & [
./handy.h​:508​:37​: note​: expanded from macro 'strnEQ'
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
  ^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
  SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
  ^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
  PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
  ^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
  ^
1 warning and 2 errors generated.
*** Error code 1

Stop.
#####

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 17, 2019

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Aug 17, 2019

From @jkeenan

On Sat, 17 Aug 2019 22​:32​:59 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:10​:38 GMT, jkeenan@​pobox.com wrote​:

When I attempt to build perl on FreeBSD using clang++ as the C-
compiler
and adding '-Duselongdouble' to the configuration options, 'make'
fails
at this relatively early point in the compilation process​:

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang -Duselongdouble
...
$ make
...
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith -Wextra
-Wc++-compat -Wwrite-strings perly.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated [-Wdeprecated]
@​

"make.freebsd11.clang++.longdouble.output.txt" 61L, 7089C
1,1 Top
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
2 errors generated.
*** Error code 1

Stop.
make​: stopped in /usr/home/jkeenan/gitwork/perl
#####

I first noticed this in smoke-test reports filed by Carlos Guevara
starting approximately 3 days ago. See, e.g.,
http​://perl5.test-smoke.org/report/93150. However, I suspect that
the
clang++/uselongdouble combination was never tested on this OS until
then. Hence, I have no evidence that this is a regression whose
diagnosis could be pinpointed by bisection. Indeed, I checked out
tags
5.22.0 and 5.26.0, tried to build perl on the same platform with
clang++
and -Duselongdouble -- and got the same or very similar build-time
failures. I've gotten the build-time failure with
clang++/uselongdouble
on both unthreaded and threaded builds.

By contrast, on this platform I *can* build perl 5 blead (a) with
g++/uselongdouble (albeit with some warnings in the same patch of
code
as cited above); and with clang/uselongdouble.

Assuming this is not a regression, and given the obscurity of this
complier/config_args combination, I'm not overly concerned about
this.
The "vendor perl" on FreeBSD is almost certainly built with clang --
not
clang++. I don't know enough about either clang++ or -Duselongdouble
to
comment usefully further. But it would be good to at least diagnose
the
problem.

The initial report usd clang++-6.

#####
$ clang++ --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on
LLVM 6.0.1)
Target​: x86_64-unknown-freebsd11.2
Thread model​: posix
InstalledDir​: /usr/bin
#####

However, I get similar failures when using clang++-8.

#####
$ clang++80 --version
clang version 8.0.1 (tags/RELEASE_801/final)
Target​: x86_64-portbld-freebsd11.2
Thread model​: posix
InstalledDir​: /usr/local/llvm80/bin
#####

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang++80 -Duselongdouble &&
make test
...
clang++80 -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith -Wextra
-Wc++-compat -Wwrite-strings sv.c
clang-8​: warning​: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated [-Wdeprecated]
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
sv.c​:12506​:41​: warning​: adding 'int' to a string does not append to
the string [-Wstring-plus-int]
&& strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
./handy.h​:508​:37​: note​: expanded from macro 'strnEQ'
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
^~
sv.c​:12506​:41​: note​: use array indexing to silence this warning
&& strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
^
& [
./handy.h​:508​:37​: note​: expanded from macro 'strnEQ'
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
1 warning and 2 errors generated.
*** Error code 1

Stop.
#####

Thank you very much.

And, similar failure with clang-6/uselongdouble on FreeBSD-12.

#####
...
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings sv.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
  SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
  ^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
  PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
  ^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
  ^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
  SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
  ^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
  PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
  ^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
  ^
2 errors generated.
*** Error code 1

Stop.
make​: stopped in /usr/home/jkeenan/gitwork/perl
#####

#####
[perl] $ uname -mrs
FreeBSD 12.0-RELEASE amd64
[perl] $ clang++ --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
Target​: x86_64-unknown-freebsd12.0
Thread model​: posix
InstalledDir​: /usr/bin
#####
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 18, 2019

From @jkeenan

On Sat, 17 Aug 2019 22​:41​:03 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:32​:59 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:10​:38 GMT, jkeenan@​pobox.com wrote​:

When I attempt to build perl on FreeBSD using clang++ as the C-
compiler
and adding '-Duselongdouble' to the configuration options, 'make'
fails
at this relatively early point in the compilation process​:

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang -Duselongdouble
...
$ make
...
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith -Wextra
-Wc++-compat -Wwrite-strings perly.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode,
this
behavior is deprecated [-Wdeprecated]
@​

"make.freebsd11.clang++.longdouble.output.txt" 61L, 7089C
1,1 Top
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
2 errors generated.
*** Error code 1

Stop.
make​: stopped in /usr/home/jkeenan/gitwork/perl
#####

I first noticed this in smoke-test reports filed by Carlos Guevara
starting approximately 3 days ago. See, e.g.,
http​://perl5.test-smoke.org/report/93150. However, I suspect that
the
clang++/uselongdouble combination was never tested on this OS until
then. Hence, I have no evidence that this is a regression whose
diagnosis could be pinpointed by bisection. Indeed, I checked out
tags
5.22.0 and 5.26.0, tried to build perl on the same platform with
clang++
and -Duselongdouble -- and got the same or very similar build-time
failures. I've gotten the build-time failure with
clang++/uselongdouble
on both unthreaded and threaded builds.

By contrast, on this platform I *can* build perl 5 blead (a) with
g++/uselongdouble (albeit with some warnings in the same patch of
code
as cited above); and with clang/uselongdouble.

Assuming this is not a regression, and given the obscurity of this
complier/config_args combination, I'm not overly concerned about
this.
The "vendor perl" on FreeBSD is almost certainly built with clang
--
not
clang++. I don't know enough about either clang++ or
-Duselongdouble
to
comment usefully further. But it would be good to at least
diagnose
the
problem.

The initial report usd clang++-6.

#####
$ clang++ --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on
LLVM 6.0.1)
Target​: x86_64-unknown-freebsd11.2
Thread model​: posix
InstalledDir​: /usr/bin
#####

However, I get similar failures when using clang++-8.

#####
$ clang++80 --version
clang version 8.0.1 (tags/RELEASE_801/final)
Target​: x86_64-portbld-freebsd11.2
Thread model​: posix
InstalledDir​: /usr/local/llvm80/bin
#####

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang++80 -Duselongdouble &&
make test
...
clang++80 -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith -Wextra
-Wc++-compat -Wwrite-strings sv.c
clang-8​: warning​: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated [-Wdeprecated]
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
sv.c​:12506​:41​: warning​: adding 'int' to a string does not append to
the string [-Wstring-plus-int]
&& strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
./handy.h​:508​:37​: note​: expanded from macro 'strnEQ'
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
^~
sv.c​:12506​:41​: note​: use array indexing to silence this warning
&& strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
^
& [
./handy.h​:508​:37​: note​: expanded from macro 'strnEQ'
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
1 warning and 2 errors generated.
*** Error code 1

Stop.
#####

Thank you very much.

And, similar failure with clang-6/uselongdouble on FreeBSD-12.

#####
...
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith -Wextra
-Wc++-compat -Wwrite-strings sv.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated [-Wdeprecated]
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
2 errors generated.
*** Error code 1

Stop.
make​: stopped in /usr/home/jkeenan/gitwork/perl
#####

#####
[perl] $ uname -mrs
FreeBSD 12.0-RELEASE amd64
[perl] $ clang++ --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on
LLVM 6.0.1)
Target​: x86_64-unknown-freebsd12.0
Thread model​: posix
InstalledDir​: /usr/bin
#####

Some findings​:

1. If on FreeBSD-11.2 I configure the simplest possible perl -- which implies using the default compiler, 'clang' -- and then ack for 'd_Gconvert', I get this​:

#####
FreeBSD-11.2
$ sh ./Configure -des -Dusedevel && ack d_Gconvert *.sh
config.sh
99​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig64.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'
#####

Note that 'd_Gconvert' is defined the same in all 3 locations.

2. If to the previous configuration I add '-Duselongdouble', I get a different definition in config.sh from the other two files​:

#####
$ sh ./Configure -des -Dusedevel -Duselongdouble && ack d_Gconvert *.sh
config.sh
99​:d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'

uconfig.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig64.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'
#####

Nonetheless, 'make' completes and 'make test_harness' gets a PASS.

3. If to the previous configuration I add '-Dcc=clang++, I get a definition for d_Gconvert in config.sh that is specified in terms of the system function 'gcvt' -- which AFAICT does not exist on FreeBSD (no man page; no pkg)!

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang++ -Duselongdouble && ack d_Gconvert *.sh
config.sh
100​:d_Gconvert='gcvt((x),(n),(b))'

uconfig.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig64.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'
#####

So why in this case is Configure using 'gcvt' as part of the value for d_Gconvert? This difference appears to be consistent with the error output.

4. Now if from the previous configuration I subtract '-Dcc=clang++' -- that is, I go back to 'clang' but retain '-Dusedouble', I get this​:

#####
$ sh ./Configure -des -Dusedevel -Duselongdouble && ack d_Gconvert *.sh
$ ack d_Gconvert *.sh
config.sh
99​:d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'

uconfig.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig64.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'
#####

And 'make test_harness' gets PASS in Case 4.

5. Now let's see what happens if I configure with clang/uselongdouble but manually edit config.sh to provide​:

#####
d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'
#####

Result​: 'make' completes successfully; 'make test_harness' PASS.

Inference​: (i) On a platform where 'gcvt' is not found; (ii) when using clang++ as the C-compiler; (iii) when configuring with '-Duselongdouble'; then ./Configure is assigning an incorrect value to 'd_Gconvert' in config.sh. The build-time errors flow therefrom. 'make' and 'clang++' are doing the right thing; ./Configure is not.

What should we do in the configuration stage to address this?

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 18, 2019

From @jkeenan

On Sun, 18 Aug 2019 01​:52​:17 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:41​:03 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:32​:59 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:10​:38 GMT, jkeenan@​pobox.com wrote​:

When I attempt to build perl on FreeBSD using clang++ as the C-
compiler
and adding '-Duselongdouble' to the configuration options, 'make'
fails
at this relatively early point in the compilation process​:

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang -Duselongdouble
...
$ make
...
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith
-Wextra
-Wc++-compat -Wwrite-strings perly.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode,
this
behavior is deprecated [-Wdeprecated]
@​

"make.freebsd11.clang++.longdouble.output.txt" 61L, 7089C
1,1 Top
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
2 errors generated.
*** Error code 1

Stop.
make​: stopped in /usr/home/jkeenan/gitwork/perl
#####

I first noticed this in smoke-test reports filed by Carlos
Guevara
starting approximately 3 days ago. See, e.g.,
http​://perl5.test-smoke.org/report/93150. However, I suspect
that
the
clang++/uselongdouble combination was never tested on this OS
until
then. Hence, I have no evidence that this is a regression whose
diagnosis could be pinpointed by bisection. Indeed, I checked
out
tags
5.22.0 and 5.26.0, tried to build perl on the same platform with
clang++
and -Duselongdouble -- and got the same or very similar build-
time
failures. I've gotten the build-time failure with
clang++/uselongdouble
on both unthreaded and threaded builds.

By contrast, on this platform I *can* build perl 5 blead (a) with
g++/uselongdouble (albeit with some warnings in the same patch of
code
as cited above); and with clang/uselongdouble.

Assuming this is not a regression, and given the obscurity of
this
complier/config_args combination, I'm not overly concerned about
this.
The "vendor perl" on FreeBSD is almost certainly built with clang
--
not
clang++. I don't know enough about either clang++ or
-Duselongdouble
to
comment usefully further. But it would be good to at least
diagnose
the
problem.

The initial report usd clang++-6.

#####
$ clang++ --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based
on
LLVM 6.0.1)
Target​: x86_64-unknown-freebsd11.2
Thread model​: posix
InstalledDir​: /usr/bin
#####

However, I get similar failures when using clang++-8.

#####
$ clang++80 --version
clang version 8.0.1 (tags/RELEASE_801/final)
Target​: x86_64-portbld-freebsd11.2
Thread model​: posix
InstalledDir​: /usr/local/llvm80/bin
#####

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang++80 -Duselongdouble &&
make test
...
clang++80 -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith -Wextra
-Wc++-compat -Wwrite-strings sv.c
clang-8​: warning​: treating 'c' input as 'c++' when in C++ mode,
this
behavior is deprecated [-Wdeprecated]
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
sv.c​:12506​:41​: warning​: adding 'int' to a string does not append to
the string [-Wstring-plus-int]
&& strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
./handy.h​:508​:37​: note​: expanded from macro 'strnEQ'
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
^~
sv.c​:12506​:41​: note​: use array indexing to silence this warning
&& strnEQ(q + 1, UTF8f + 2, sizeof(UTF8f) - 3))
^
& [
./handy.h​:508​:37​: note​: expanded from macro 'strnEQ'
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)
^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
1 warning and 2 errors generated.
*** Error code 1

Stop.
#####

Thank you very much.

And, similar failure with clang-6/uselongdouble on FreeBSD-12.

#####
...
clang++ -c -DPERL_CORE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-I/usr/local/include -D_FORTIFY_SOURCE=2 -ansi -O2 -Wall
-Werror=declaration-after-statement -Werror=pointer-arith -Wextra
-Wc++-compat -Wwrite-strings sv.c
clang++​: warning​: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated [-Wdeprecated]
sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
sv.c​:13075​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^
2 errors generated.
*** Error code 1

Stop.
make​: stopped in /usr/home/jkeenan/gitwork/perl
#####

#####
[perl] $ uname -mrs
FreeBSD 12.0-RELEASE amd64
[perl] $ clang++ --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on
LLVM 6.0.1)
Target​: x86_64-unknown-freebsd12.0
Thread model​: posix
InstalledDir​: /usr/bin
#####

Some findings​:

1. If on FreeBSD-11.2 I configure the simplest possible perl -- which
implies using the default compiler, 'clang' -- and then ack for
'd_Gconvert', I get this​:

#####
FreeBSD-11.2
$ sh ./Configure -des -Dusedevel && ack d_Gconvert *.sh
config.sh
99​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig64.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'
#####

Note that 'd_Gconvert' is defined the same in all 3 locations.

2. If to the previous configuration I add '-Duselongdouble', I get a
different definition in config.sh from the other two files​:

#####
$ sh ./Configure -des -Dusedevel -Duselongdouble && ack d_Gconvert
*.sh
config.sh
99​:d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'

uconfig.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig64.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'
#####

Nonetheless, 'make' completes and 'make test_harness' gets a PASS.

3. If to the previous configuration I add '-Dcc=clang++, I get a
definition for d_Gconvert in config.sh that is specified in terms of
the system function 'gcvt' -- which AFAICT does not exist on FreeBSD
(no man page; no pkg)!

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang++ -Duselongdouble && ack
d_Gconvert *.sh
config.sh
100​:d_Gconvert='gcvt((x),(n),(b))'

uconfig.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig64.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'
#####

So why in this case is Configure using 'gcvt' as part of the value for
d_Gconvert? This difference appears to be consistent with the error
output.

4. Now if from the previous configuration I subtract '-Dcc=clang++' --
that is, I go back to 'clang' but retain '-Dusedouble', I get this​:

#####
$ sh ./Configure -des -Dusedevel -Duselongdouble && ack d_Gconvert
*.sh
$ ack d_Gconvert *.sh
config.sh
99​:d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'

uconfig.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

uconfig64.sh
30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'
#####

And 'make test_harness' gets PASS in Case 4.

5. Now let's see what happens if I configure with clang/uselongdouble
but manually edit config.sh to provide​:

#####
d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'
#####

Result​: 'make' completes successfully; 'make test_harness' PASS.

Inference​: (i) On a platform where 'gcvt' is not found; (ii) when
using clang++ as the C-compiler; (iii) when configuring with '-
Duselongdouble'; then ./Configure is assigning an incorrect value to
'd_Gconvert' in config.sh. The build-time errors flow therefrom.
'make' and 'clang++' are doing the right thing; ./Configure is not.

What should we do in the configuration stage to address this?

Thank you very much.

I created this branch to analyze the problem​:

smoke-me/jkeenan/134371-gconvert

See RT 134375 for what may be a more general problem.

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 2019

From @doughera88

On Sun, Aug 18, 2019 at 08​:09​:04AM -0700, James E Keenan via RT wrote​:

On Sun, 18 Aug 2019 01​:52​:17 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:41​:03 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:32​:59 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:10​:38 GMT, jkeenan@​pobox.com wrote​:

When I attempt to build perl on FreeBSD using clang++ as the C-
compiler
and adding '-Duselongdouble' to the configuration options, 'make'
fails
at this relatively early point in the compilation process​:

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang -Duselongdouble
...
$ make
...

sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^

Inference​: (i) On a platform where 'gcvt' is not found; (ii) when
using clang++ as the C-compiler; (iii) when configuring with '-
Duselongdouble'; then ./Configure is assigning an incorrect value to
'd_Gconvert' in config.sh. The build-time errors flow therefrom.
'make' and 'clang++' are doing the right thing; ./Configure is not.

What should we do in the configuration stage to address this?

Thank you very much.

I created this branch to analyze the problem​:

smoke-me/jkeenan/134371-gconvert

See RT 134375 for what may be a more general problem.

clang++ seems to be in error here, but the relevant Configure program
isn't C++ clean either, and that might confuse things. I've pushed a
tiny tweak to the Configure program in the smoke-me branch that might
avoid the problem. Can you give it a try?

Thanks,

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 2019

From @jkeenan

On Mon, 19 Aug 2019 02​:21​:01 GMT, doughera wrote​:

On Sun, Aug 18, 2019 at 08​:09​:04AM -0700, James E Keenan via RT wrote​:

On Sun, 18 Aug 2019 01​:52​:17 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:41​:03 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:32​:59 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:10​:38 GMT, jkeenan@​pobox.com wrote​:

When I attempt to build perl on FreeBSD using clang++ as the C-
compiler
and adding '-Duselongdouble' to the configuration options, 'make'
fails
at this relatively early point in the compilation process​:

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang -Duselongdouble
...
$ make
...

sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^

Inference​: (i) On a platform where 'gcvt' is not found; (ii) when
using clang++ as the C-compiler; (iii) when configuring with '-
Duselongdouble'; then ./Configure is assigning an incorrect value to
'd_Gconvert' in config.sh. The build-time errors flow therefrom.
'make' and 'clang++' are doing the right thing; ./Configure is not.

What should we do in the configuration stage to address this?

Thank you very much.

I created this branch to analyze the problem​:

smoke-me/jkeenan/134371-gconvert

See RT 134375 for what may be a more general problem.

clang++ seems to be in error here, but the relevant Configure program
isn't C++ clean either, and that might confuse things. I've pushed a
tiny tweak to the Configure program in the smoke-me branch that might
avoid the problem. Can you give it a try?

Thanks,

When I run ./Configure (which will be Monday, as it's late here), should I be testing *both* your commit in the branch and mine (a9425c4 and 74cd64c), or just yours (a9425c4)?

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 2019

From @doughera88

On Sun, Aug 18, 2019 at 08​:20​:56PM -0700, James E Keenan via RT wrote​:

On Mon, 19 Aug 2019 02​:21​:01 GMT, doughera wrote​:

On Sun, Aug 18, 2019 at 08​:09​:04AM -0700, James E Keenan via RT wrote​:

On Sun, 18 Aug 2019 01​:52​:17 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:41​:03 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:32​:59 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:10​:38 GMT, jkeenan@​pobox.com wrote​:

When I attempt to build perl on FreeBSD using clang++ as the C-
compiler
and adding '-Duselongdouble' to the configuration options, 'make'
fails
at this relatively early point in the compilation process​:

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang -Duselongdouble
...
$ make
...

sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv), NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0, buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^

Inference​: (i) On a platform where 'gcvt' is not found; (ii) when
using clang++ as the C-compiler; (iii) when configuring with '-
Duselongdouble'; then ./Configure is assigning an incorrect value to
'd_Gconvert' in config.sh. The build-time errors flow therefrom.
'make' and 'clang++' are doing the right thing; ./Configure is not.

What should we do in the configuration stage to address this?

Thank you very much.

I created this branch to analyze the problem​:

smoke-me/jkeenan/134371-gconvert

See RT 134375 for what may be a more general problem.

clang++ seems to be in error here, but the relevant Configure program
isn't C++ clean either, and that might confuse things. I've pushed a
tiny tweak to the Configure program in the smoke-me branch that might
avoid the problem. Can you give it a try?

Thanks,

When I run ./Configure (which will be Monday, as it's late here), should I be testing *both* your commit in the branch and mine (a9425c4 and 74cd64c), or just yours (a9425c4)?

Both commits are fine. Run Configure without the -s option. You should no
longer see the 'oddity' string in the output. You should also never get to
the WHOA THERE warning branch your commit dealt with.

Thanks for testing!

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 2019

From @jkeenan

On Mon, 19 Aug 2019 11​:02​:50 GMT, doughera wrote​:

On Sun, Aug 18, 2019 at 08​:20​:56PM -0700, James E Keenan via RT wrote​:

On Mon, 19 Aug 2019 02​:21​:01 GMT, doughera wrote​:

On Sun, Aug 18, 2019 at 08​:09​:04AM -0700, James E Keenan via RT
wrote​:

On Sun, 18 Aug 2019 01​:52​:17 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:41​:03 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:32​:59 GMT, jkeenan wrote​:

On Sat, 17 Aug 2019 22​:10​:38 GMT, jkeenan@​pobox.com wrote​:

When I attempt to build perl on FreeBSD using clang++ as
the C-
compiler
and adding '-Duselongdouble' to the configuration
options, 'make'
fails
at this relatively early point in the compilation
process​:

#####
$ sh ./Configure -des -Dusedevel -Dcc=clang
-Duselongdouble
...
$ make
...

sv.c​:3206​:21​: error​: use of undeclared identifier 'gcvt'
SNPRINTF_G(SvNVX(sv), s, SvLEN(sv),
NV_DIG);
^
sv.c​:48​:24​: note​: expanded from macro 'SNPRINTF_G'
PERL_UNUSED_RESULT(Gconvert((NV)(nv), (int)ndig, 0,
buffer))
^
./config.h​:909​:27​: note​: expanded from macro 'Gconvert'
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
^

Inference​: (i) On a platform where 'gcvt' is not found; (ii)
when
using clang++ as the C-compiler; (iii) when configuring with '-
Duselongdouble'; then ./Configure is assigning an incorrect
value to
'd_Gconvert' in config.sh. The build-time errors flow
therefrom.
'make' and 'clang++' are doing the right thing; ./Configure is
not.

What should we do in the configuration stage to address this?

Thank you very much.

I created this branch to analyze the problem​:

smoke-me/jkeenan/134371-gconvert

See RT 134375 for what may be a more general problem.

clang++ seems to be in error here, but the relevant Configure
program
isn't C++ clean either, and that might confuse things. I've pushed
a
tiny tweak to the Configure program in the smoke-me branch that
might
avoid the problem. Can you give it a try?

Thanks,

When I run ./Configure (which will be Monday, as it's late here),
should I be testing *both* your commit in the branch and mine
(a9425c4 and 74cd64c), or just yours (a9425c4)?

Both commits are fine. Run Configure without the -s option. You
should no
longer see the 'oddity' string in the output. You should also never
get to
the WHOA THERE warning branch your commit dealt with.

Thanks for testing!

Looks good!

#####
$ sh ./Configure -de -Dusedevel -Dcc=clang++ -Duselongdouble
...
$ grep -n WHOA Configure.a9425c44.clang++.longdouble.output.txt
$ grep -n -E 'oddity|WHOA' Configure.a9425c44.clang++.longdouble.output.txt
$ grep -n -i Gconvert ~/gitwork/perl/*.sh
$ grep -n -i Gconvert *.sh
config.sh​:100​:d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'
uconfig.sh​:30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'
uconfig64.sh​:30​:d_Gconvert='sprintf((b),"%.*g",(n),(x))'

$ make
[# completed successfully ]
$ make test_harness
[# completed successfully ]
#####

Branch rebased on blead and pushed to origin.

Now, assuming smoke tests confirm the validity of these patches on other platforms, we have solved the immediate problem posed in this RT. But there is probably still a problem with clang++, as suggested in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=134375.  Have you had a chance to look at that?

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 19, 2019

From @doughera88

On Mon, Aug 19, 2019 at 05​:18​:58AM -0700, James E Keenan via RT wrote​:

On Mon, 19 Aug 2019 11​:02​:50 GMT, doughera wrote​:

clang++ seems to be in error here, but the relevant Configure
program
isn't C++ clean either, and that might confuse things. I've pushed
a
tiny tweak to the Configure program in the smoke-me branch that
might
avoid the problem. Can you give it a try?

Looks good!

#####
$ sh ./Configure -de -Dusedevel -Dcc=clang++ -Duselongdouble
...
$ grep -n WHOA Configure.a9425c44.clang++.longdouble.output.txt
$ grep -n -E 'oddity|WHOA' Configure.a9425c44.clang++.longdouble.output.txt
$ grep -n -i Gconvert ~/gitwork/perl/*.sh
$ grep -n -i Gconvert *.sh
config.sh​:100​:d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'

$ make
[# completed successfully ]
$ make test_harness
[# completed successfully ]

Now, assuming smoke tests confirm the validity of these patches on other platforms, we have solved the immediate problem posed in this RT. But there is probably still a problem with clang++, as suggested in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=134375.  Have you had a chance to look at that?

Yes. I have reduced it to a simple test case and have started the
process of submitting a bug report to the clang project. Configure's
probe program is also to blame -- I have a function declared 'int checkit()'
that never actually returns anything -- but clang++'s failure mode is
also not helpful here.

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Aug 20, 2019

From @jkeenan

On Mon, 19 Aug 2019 16​:09​:14 GMT, doughera wrote​:

On Mon, Aug 19, 2019 at 05​:18​:58AM -0700, James E Keenan via RT wrote​:

On Mon, 19 Aug 2019 11​:02​:50 GMT, doughera wrote​:

clang++ seems to be in error here, but the relevant Configure
program
isn't C++ clean either, and that might confuse things. I've
pushed
a
tiny tweak to the Configure program in the smoke-me branch that
might
avoid the problem. Can you give it a try?

Looks good!

#####
$ sh ./Configure -de -Dusedevel -Dcc=clang++ -Duselongdouble
...
$ grep -n WHOA Configure.a9425c44.clang++.longdouble.output.txt
$ grep -n -E 'oddity|WHOA'
Configure.a9425c44.clang++.longdouble.output.txt
$ grep -n -i Gconvert ~/gitwork/perl/*.sh
$ grep -n -i Gconvert *.sh
config.sh​:100​:d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'

$ make
[# completed successfully ]
$ make test_harness
[# completed successfully ]

Now, assuming smoke tests confirm the validity of these patches on
other platforms, we have solved the immediate problem posed in this
RT. But there is probably still a problem with clang++, as suggested
in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=134375.  Have you had a
chance to look at that?

Yes. I have reduced it to a simple test case and have started the
process of submitting a bug report to the clang project. Configure's
probe program is also to blame -- I have a function declared 'int
checkit()'
that never actually returns anything -- but clang++'s failure mode is
also not helpful here.

Now that 5.31.3 is out I will merge the branch into blead and squash to a single commit.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 20, 2019

From @jkeenan

On Tue, 20 Aug 2019 16​:36​:40 GMT, jkeenan wrote​:

On Mon, 19 Aug 2019 16​:09​:14 GMT, doughera wrote​:

On Mon, Aug 19, 2019 at 05​:18​:58AM -0700, James E Keenan via RT
wrote​:

On Mon, 19 Aug 2019 11​:02​:50 GMT, doughera wrote​:

clang++ seems to be in error here, but the relevant Configure
program
isn't C++ clean either, and that might confuse things. I've
pushed
a
tiny tweak to the Configure program in the smoke-me branch
that
might
avoid the problem. Can you give it a try?

Looks good!

#####
$ sh ./Configure -de -Dusedevel -Dcc=clang++ -Duselongdouble
...
$ grep -n WHOA Configure.a9425c44.clang++.longdouble.output.txt
$ grep -n -E 'oddity|WHOA'
Configure.a9425c44.clang++.longdouble.output.txt
$ grep -n -i Gconvert ~/gitwork/perl/*.sh
$ grep -n -i Gconvert *.sh
config.sh​:100​:d_Gconvert='sprintf((b),"%.*""Lg",(n),(x))'

$ make
[# completed successfully ]
$ make test_harness
[# completed successfully ]

Now, assuming smoke tests confirm the validity of these patches on
other platforms, we have solved the immediate problem posed in this
RT. But there is probably still a problem with clang++, as
suggested
in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=134375.  Have you had
a
chance to look at that?

Yes. I have reduced it to a simple test case and have started the
process of submitting a bug report to the clang project. Configure's
probe program is also to blame -- I have a function declared 'int
checkit()'
that never actually returns anything -- but clang++'s failure mode is
also not helpful here.

Now that 5.31.3 is out I will merge the branch into blead and squash
to a single commit.

Merged to blead in commit 1e1b6d9. Will monitor for several days before closing. Other clang++- and uselongdouble-related tickets remain open.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 30, 2019

@jkeenan - Status changed from 'open' to 'pending release'

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

No branches or pull requests

2 participants