mainAutoconf - Support: sr #110377, AC_CACHE_CHECK is affected by 's'...

 
 

sr #110377: AC_CACHE_CHECK is affected by 's' variable override.

Submitter:  Sergei Trofimovich <slyfox>
Submitted:  Mon 16 Nov 2020 11:42:31 AM UTC
   
 
Priority:  * 5 - Unprioritized Severity:  3 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 16 Nov 2020 06:12:57 PM UTC, comment #3: 

Indeed, that was never guaranteed to work.  AC_PREPROC_IFELSE is the recommended way to write that kind of test.

Zack Weinberg <zackw>
Group administrator
Mon 16 Nov 2020 06:05:19 PM UTC, comment #2: 

Your fix helped, thank you!

The only other tweak I had to do was to avoid here-document split across multiple expressions:


    AS_IF([! $CC -E -xc - <<SRC >/dev/null], [
        @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
        @%:@error premature clang
        @%:@endif
SRC
        AC_MSG_ERROR([clang version 3.0 or later is required])
    ])


Tried to fix it as https://github.com/ruby/ruby/pull/3773. I assume initial for was never guaranteed to work.

Sergei Trofimovich <slyfox>
Mon 16 Nov 2020 03:13:08 PM UTC, comment #1: 

Thanks for catching this!  Fixed in b7e32b4dc746ea867ed68f41d767178b34cc43a0.

I hope to make the final release of 2.70 before the end of November; if you could please re-test with git trunk ASAP and report those other issues you mentioned, I'd appreciate it.

Zack Weinberg <zackw>
Group administrator
Mon 16 Nov 2020 11:42:31 AM UTC, original submission:  

Initial failure happens on ruby git version against autoconf-2.69d. It has a few issues, but I'm focusing here on redefinition of `s` variable.

Here is a minimal example that demonstrates a problem of substituted variable. If does not show behaviour difference in minimal snippet, but points at mangled printf argument.


$ autoreconf-2.69 --install && ./configure --host=x86_64-pc-linux-gnu
checking size of int... 1
rbcv_sizeof_size is defined as 42
ac_cv_sizeof_int=1
configure: creating ./config.status



$ autoreconf-2.70_beta3 --install && ./configure --host=x86_64-pc-linux-gnu
./configure: line 1716: printf: `r': invalid format character
./configure: line 1717: printf: `r': invalid format character
./configure: line 1724: printf: `r': invalid format character
./configure: line 1725: printf: `r': invalid format character
rbcv_sizeof_size is defined as 42
ac_cv_sizeof_int=1
configure: creating ./config.status



$ cat configure.ac
AC_INIT

dnl trimmed douwn version of orifginal 'RUBY_CHECK_SIZEOF' macro
dnl from https://github.com/ruby/ruby/blob/master/tool/m4/ruby_check_sizeof.m4
dnl
dnl The important bit is 's' m4 variable that breaks printf call.
AC_DEFUN([RUBY_CHECK_SIZEOF],[
AS_VAR_PUSHDEF([s], [rbcv_sizeof_size])dnl
AC_CACHE_CHECK([size of $1], [AS_TR_SH([ac_cv_sizeof_$1])], [AS_TR_SH(ac_cv_sizeof_$1)=1])

# fake use of 's' for illustratve purposes:
s=42
echo "s is defined as ${s}"

AS_VAR_POPDEF([s])
])

RUBY_CHECK_SIZEOF(int)
echo "ac_cv_sizeof_int=${ac_cv_sizeof_int}"

AC_OUTPUT


Sergei Trofimovich <slyfox>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by zackw (Posted a comment)
  • -email is unavailable- added by slyfox (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-16 zackw StatusNone Done
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code