mainAutoconf - Support: sr #110393, Unconditional include of stdio.h...

 
 

sr #110393: Unconditional include of stdio.h should be avoided

Submitter:  None
Submitted:  Sun 06 Dec 2020 11:39:26 AM UTC
   
 
Priority:  * 5 - Unprioritized Severity:  3 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Closed Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 07 Dec 2020 02:14:08 AM UTC, comment #3: 

Thanks for testing so quickly.

Zack Weinberg <zackw>
Group administrator
Mon 07 Dec 2020 01:47:35 AM UTC, comment #2: 

I've tested your changes. Everything works right now. Thank you. The bug report can be closed as solved.

Anonymous
Sun 06 Dec 2020 09:53:14 PM UTC, comment #1: 

Nice catch; we have never really tested Autoconf with compilers for freestanding environments.  I can't guarantee that Autoconf 2.70 will work 100% for you, but this specific problem should be addressed by commits b045574cb2ea1c8441be7a7b56fd471d704ebf3a and 131d8c69f31dc6fc8dc93abe1096d52d1fe19fd3.

Before I close the bug report, I'd appreciate it if you could re-test autoconf git trunk in your environment.  Autoconf's own test suite will probably not run cleanly, but your library's configure script should work much better.

(See https://savannah.gnu.org/git/?group=autoconf for instructions for accessing autoconf git trunk, and README-hacking in the source tree for how to build it.)

(If you find more, different problems, please report them as separate bugs.  I cannot promise to get them fixed for 2.70, which is being released in two days no matter what, but at least we will have them on record.)

Zack Weinberg <zackw>
Group administrator
Sun 06 Dec 2020 11:39:26 AM UTC, original submission:  

I'm building my library with cross-compiler without stdlib, so only several headers are present (stdbool.h, stddef.h, stdarg.h, etc). Header stdio.h is not present. However, it's used unconditionally in AC_CHECK_HEADER_STDBOOL and AC_CHECK_HEADERS, so I receive the following output:

> checking for _Bool... no
> checking stddef.h usability... no
> checking stddef.h presence... yes
> configure: WARNING: stddef.h: present but cannot be compiled
> configure: WARNING: stddef.h:     check for missing prerequisite headers?
> configure: WARNING: stddef.h: see the Autoconf documentation
> configure: WARNING: stddef.h:     section "Present But Cannot Be Compiled"
> configure: WARNING: stddef.h: proceeding with the compiler's result
> configure: WARNING:     ## ------------------------------------------------------------ ##
> configure: WARNING:     ## Report this to https://github.com/kernelmq/libkernaux/issues ##
> configure: WARNING:     ## ------------------------------------------------------------ ##
> checking for stddef.h... no


config.log explains why checks fail:

> configure:5777: checking for _Bool
> configure:5777: /home/kotovalexarian/repos/github/kernelmq/kernelmq/vendor/crosscompiler/bin/i686-elf-gcc -c -ffreestanding -nostdlib -fno-builtin -fno-stack-protector  conftest.c >&5
> conftest.c:16:10: fatal error: stdio.h: No such file or directory
>  #include <stdio.h>
>           ^~~~~~~~~
> compilation terminated.
> configure:5777: $? = 1
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME "libkernaux"
> | #define PACKAGE_TARNAME "libkernaux"
> | #define PACKAGE_VERSION "0.0.0"
> | #define PACKAGE_STRING "libkernaux 0.0.0"
> | #define PACKAGE_BUGREPORT "https://github.com/kernelmq/libkernaux/issues"
> | #define PACKAGE_URL "https://github.com/kernelmq/libkernaux"
> | #define ARCH_X86 1
> | #define ENABLE_CMDLINE 1
> | #define ENABLE_CONSOLE 1
> | #define ENABLE_MULTIBOOT2 1
> | #define ENABLE_PFA 1
> | #define PACKAGE "libkernaux"
> | #define VERSION "0.0.0"
> | /* end confdefs.h.  */
> | #include <stdio.h>
> | #ifdef HAVE_SYS_TYPES_H
> | # include <sys/types.h>
> | #endif
> | #ifdef HAVE_SYS_STAT_H
> | # include <sys/stat.h>
> | #endif
> | #ifdef STDC_HEADERS
> | # include <stdlib.h>
> | # include <stddef.h>
> | #else
> | # ifdef HAVE_STDLIB_H
> | #  include <stdlib.h>
> | # endif
> | #endif
> | #ifdef HAVE_STRING_H
> | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
> | #  include <memory.h>
> | # endif
> | # include <string.h>
> | #endif
> | #ifdef HAVE_STRINGS_H
> | # include <strings.h>
> | #endif
> | #ifdef HAVE_INTTYPES_H
> | # include <inttypes.h>
> | #endif
> | #ifdef HAVE_STDINT_H
> | # include <stdint.h>
> | #endif
> | #ifdef HAVE_UNISTD_H
> | # include <unistd.h>
> | #endif
> | int
> | main ()
> | {
> | if (sizeof (_Bool))
> | return 0;
> |   ;
> |   return 0;
> | }
> configure:5777: result: no

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50408:  config.log added by None (86KiB - text/x-log)

 

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 None (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-12-07 zackw StatusReady For Test Done
        Open/ClosedOpen Closed
    2020-12-06 zackw StatusNone Ready For Test
    2020-12-06 None Attached File- Added config.log, #50408

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code