STRERROR_R_CHAR_P broken

2020-11-04 Thread Pascal Terjan
After 
http://git.savannah.gnu.org/cgit/autoconf.git/commit/lib/autoconf/functions.m4?id=326c9a547423d25c621bc5c0ef76edbf6eda8c92
detection fails because  is no longer included.

checking whether strerror_r is declared... yes
checking whether strerror_r returns char *... no

configure:11444: x86_64-mageia-linux-gnu-gcc -c -O2 -g -pipe -Wformat
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4 -fstack-protector-all
-fasynchronous-unwind-tables -I/usr/include/et -fPIC
-fno-strict-aliasing -fstack-protector-all -I/usr/include/et
conftest.c >&5
conftest.c: In function 'main':
conftest.c:77:14: warning: implicit declaration of function
'strerror_r' [-Wimplicit-function-declaration]
   77 |char x = *strerror_r (0, buf, sizeof buf);
  |  ^~
conftest.c:77:13: error: invalid type argument of unary '*' (have 'int')
   77 |char x = *strerror_r (0, buf, sizeof buf);
  | ^~~~
conftest.c:78:14: warning: initialization of 'char *' from 'int' makes
pointer from integer without a cast [-Wint-conversion]
   78 |char *p = strerror_r (0, buf, sizeof buf);
  |  ^~
configure:11444: $? = 1


The suspicious part of the commit is:

-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],



[sr #110362] STRERROR_R_CHAR_P broken by 326c9a547423d25c621bc5c0ef76edbf6eda8c92

2020-11-04 Thread anonymous
URL:
  

 Summary: STRERROR_R_CHAR_P broken by
326c9a547423d25c621bc5c0ef76edbf6eda8c92
 Project: Autoconf
Submitted by: None
Submitted on: Wed 04 Nov 2020 09:08:51 PM UTC
Category: None
Priority: 5 - Normal
Severity: 3 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: pter...@gmail.com
 Open/Closed: Open
 Discussion Lock: Any
Operating System: GNU/Linux

___

Details:

After
http://git.savannah.gnu.org/cgit/autoconf.git/commit/lib/autoconf/functions.m4?id=326c9a547423d25c621bc5c0ef76edbf6eda8c92
detection fails because  is no longer included.


checking whether strerror_r is declared... yes
checking whether strerror_r returns char *... no



configure:11444: x86_64-mageia-linux-gnu-gcc -c -O2 -g -pipe -Wformat
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4 -fstack-protector-all
-fasynchronous-unwind-tables -I/usr/include/et -fPIC
-fno-strict-aliasing -fstack-protector-all -I/usr/include/et
conftest.c >&5
conftest.c: In function 'main':
conftest.c:77:14: warning: implicit declaration of function
'strerror_r' [-Wimplicit-function-declaration]
   77 |char x = *strerror_r (0, buf, sizeof buf);
  |  ^~
conftest.c:77:13: error: invalid type argument of unary '*' (have 'int')
   77 |char x = *strerror_r (0, buf, sizeof buf);
  | ^~~~
conftest.c:78:14: warning: initialization of 'char *' from 'int' makes
pointer from integer without a cast [-Wint-conversion]
   78 |char *p = strerror_r (0, buf, sizeof buf);
  |  ^~
configure:11444: $? = 1


The suspicious part of the commit is:


-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],





___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3

2020-11-04 Thread Zack Weinberg
Follow-up Comment #9, sr #110360 (project autoconf):

I looked over spinhawk/configure.ac and I can now say with confidence that you
shouldn't override $host_cpu.  "armv7l" is *not* incorrect, just not
recognized as a -march= argument by GCC; changing it to start with "cortex"
will cause a whole bunch of "case $host_cpu in" blocks later in the configure
script to make the wrong choice.

I think the *proper* fix is for the code that sets $hc_cv_optimization_flags
(e.g. https://github.com/rbowler/spinhawk/blob/master/configure.ac#L1909)...


case "$host_cpu-$GCC" in
...
xscale-yes|arm*-yes)

hc_cv_is_intel_x86_arch=no
hc_cv_optimization_flags="$hc_cv_optimization_flags
-mcpu=$host_cpu -mtune=$host_cpu -frename-registers"
;;


to become aware that the value of $host_cpu is *not* necessarily usable as the
argument to either -mcpu= or -mtune=.  What I would recommend is for this
entire mess to be replaced with `-O2 -march=native -mtune=native` in native
compilation.  Cross compilation could continue to use $host_cpu as the
default, but a command-line option should be added (using AC_ARG_WITH) that
lets people set it to whatever specific thing they want.

I think this is not a bug in autoconf or automake, and should be re-filed as a
bug on spinhawk.  Viktor, it's probably best if you do that, but feel free to
cc: me on it (my Github handle is @zackw).

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3

2020-11-04 Thread Jannick
Follow-up Comment #8, sr #110360 (project autoconf):

[comment #7 comment #7:]
> The CPU names never contain underscores, do they? 
No, there are CPUs containing an underscore. 

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110361] build-aux files should not get a program-suffix when being installed

2020-11-04 Thread Lars Wendler
URL:
  

 Summary: build-aux files should not get a program-suffix when
being installed
 Project: Autoconf
Submitted by: polyc
Submitted on: Wed 04 Nov 2020 04:16:13 PM CET
Category: None
Priority: 5 - Normal
Severity: 3 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
Operating System: GNU/Linux

___

Details:

This has originally been filed at Gentoo downstream:
https://bugs.gentoo.org/753023

autoreconf fails to find its config.{guess,sub} and install-sh files because
when autoconf-2.69d is being installed with --program-suffix="-suffix"
configure option that adds version suffix
to the build-aux files as well:

/usr/share/autoconf-2.69d/build-aux/config.guess-suffix
/usr/share/autoconf-2.69d/build-aux/config.sub-suffix
/usr/share/autoconf-2.69d/build-aux/install-sh-suffix

but autoreconf is looking for the unversioned files.




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3

2020-11-04 Thread Viktor Engelmann
Follow-up Comment #7, sr #110360 (project autoconf):

It works on both models with

host_cpu=$(LANG=en_US lscpu | grep 'Model name' | cut -d: -f2 | tr '[:upper:]'
'[:lower:]')

I'm thinking about how you would cross-compile to Raspberry... you'd have to
set a --host, but couldn't set that to cortex-aXX. The CPU names never contain
underscores, do they? So you could specify --host=cortex_a53-os-abi or return
cortex_a53-os-abi from config.guess and sed s/_/-/g that somewhere in
AC_CANONICAL_HOST...

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110312] 2.69b: broken AC_PROG_LEX macro

2020-11-04 Thread Zack Weinberg
Follow-up Comment #11, sr #110312 (project autoconf):

That's unfortunate.  I agree we really need Tomasz's input to make any further
progress here.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110312] 2.69b: broken AC_PROG_LEX macro

2020-11-04 Thread Jannick
Follow-up Comment #10, sr #110312 (project autoconf):

@Zack: I cannot reproduce the issue either. For both autoconf 2.69 and 2.69b
the tiny configure.ac below yields (wih flex 2.6.4): 

checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... -lfl
checking whether yytext is a pointer... yes


For autoconf 2.69d:

checking for flex... flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... -lfl
checking whether yytext is a pointer... yes

Anything I can do? I guess it would be best to get the config.logs from
Tomasz's runs for autoconf 2.69 and 2.69b to see what was happening. 

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3

2020-11-04 Thread Viktor Engelmann
Follow-up Comment #6, sr #110360 (project autoconf):

I have tested the most recent config.guess and config.sub on a Raspberry Pi 4
now - and I see "armv7l" there, too. That is a Cortex-A73, though.

Yes, I think $host_cpu is passed to -mcpu at least if it starts with "arm".
It's this project: 
https://github.com/rbowler/spinhawk/pull/96

I have the x-trick right in the configure.ac - I just mistyped it when I put
it here. Sorry for the noise.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3

2020-11-04 Thread Zack Weinberg
Follow-up Comment #5, sr #110360 (project autoconf):

Yeah, I don't think there will ever be an official CPU-COMPANY-SYSTEM triplet
where CPU contains a dash.  That would break far too many existing parsers. 
Also, there are dozens of programs out there that expect $host_cpu to start
with "arm" for *all* ARM32 CPUs; "cortex-a53" doesn't fit that pattern.

Do I understand correctly that this package assumes that $host_cpu will always
be directly usable as the argument to GCC's `-march=` switch?  If so, I think
that's a bug in the package.  GCC has never guaranteed that that will work, as
far as I know.

> AS_IF([test "x$host_cpu" = 'armv7l'],[host_cpu=cortex-a53])

* This should be `test "x$host_cpu" = xarmv7l`; the x-trick requires a leading
x on _both_ operands to the comparison.
** In this case you don't need the x-trick, you can use `test "$host_cpu" =
armv7l`. After AC_CANONICAL_HOST, $host_cpu is guaranteed to be nonempty, and
not to start with a dash.
* Not all "armv7l" CPUs are Cortex-A53s.  You might need to parse the output
of `lscpu` yourself here.

If you tell me which package this is, I might be able to make some more
specific suggestions.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3

2020-11-04 Thread Viktor Engelmann
Follow-up Comment #4, sr #110360 (project autoconf):

@Jannick
Thanks! I didn't want to pass a --host, because that would break
cross-platform compatibility. So I have put this into configure.ac

> 
> # override host_cpu in in special case (having dash)
> AS_IF([test "x$host_cpu" = 'armv7l'],[host_cpu=cortex-a53])
> AC_SUBST([host_cpu])
> 

That works without setting --host.
Not a perfect solution, but a suitable workaround.

I had tried something like that before, but had used BASH syntax, which hadn't
worked.

> @Zack:  Not sure if AC_CONONICAL_HOST and cousins should be prepared to be
able to digest also quadruplets config.sub might generate?

As I said, quadruples do produce an error

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




Re: Space in dirs break `make install`

2020-11-04 Thread Ole Tange
On Wed, Oct 28, 2020 at 2:19 PM Zack Weinberg  wrote:
:
> This is a mess, but see how it _always_ expands $(DESTDIR)$(bindir)
> inside shell quotes?  To handle spaces in installation directories
> correctly, you have to do the same thing in every rule you write
> yourself.

You are absolutely right. I copied that from an example in 2014,
though I have no ideas where from.

Thanks for your help.

/Ole



[sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3

2020-11-04 Thread Jannick
Follow-up Comment #3, sr #110360 (project autoconf):

As of now AC_CANONICAL_HOST, AC_CANONICAL_BUILD and AC_CANONICAL_TARGET expect
pure triplets.  The latest config.sub might return a triplet or a quadruplet
(see the header of config.sub).  It appears unlikely that a cpu having a dash
can meet the 3/4-plet nomenclature requirements in any way. 

Victor, this *evil* hackery might do the job in your case:  Add in
configure.ac (right below AC_CANONICAL_HOST)

# override host_cpu in in special case (having dash)
AS_IF([test "x$host_cpu" = 'xcortex_a53'],[host_cpu=cortex-a53])
AC_SUBST([host_cpu])

and smuggle the artificial triplet 'cortex_a53--' (with _vendor_
and _os_ set appropriately) into autoconf like so

./configure --build=cortex_a53--   


@Zack:  Not sure if AC_CONONICAL_HOST and cousins should be prepared to be
able to digest also quadruplets config.sub might generate?

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110360] AC_CANONICAL_HOST sets wrong $host_cpu on Raspberry Pi 3

2020-11-04 Thread Viktor Engelmann
Follow-up Comment #2, sr #110360 (project autoconf):

config.guess prints armv7l-unknown-linux-gnueabihf

I just pulled the most recent versions of config.guess and config.sub to be
sure. Same problem.

Not sure how these 2 CAN respond, to get a cpu with a dash through the rest of
autoconf...

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/