stderred icon indicating copy to clipboard operation
stderred copied to clipboard

Feature: Does not build with musl_libc on Alpine Linux

Open pkostic-dev opened this issue 4 years ago • 0 comments

Feature request

Add Alpine Linux support, has musl_libc instead of glibc.

OS : "Alpine Linux v3.13"

After make :

mkdir build && cd build && cmake ../src && make
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_GLIBC
-- Performing Test HAVE_GLIBC - Failed
-- Looking for include file error.h
-- Looking for include file error.h - not found
-- Looking for include file err.h
-- Looking for include file err.h - found
-- Looking for fwrite_unlocked
-- Looking for fwrite_unlocked - found
-- Looking for fputs_unlocked
-- Looking for fputs_unlocked - found
-- Looking for fputc_unlocked
-- Looking for fputc_unlocked - found
-- Looking for fprintf_unlocked
-- Looking for fprintf_unlocked - not found
-- Looking for error
-- Looking for error - not found
-- Looking for error_at_line
-- Looking for error_at_line - not found
-- Looking for err
-- Looking for err - found
-- Looking for verr
-- Looking for verr - found
-- Looking for errc
-- Looking for errc - not found
-- Looking for verrc
-- Looking for verrc - not found
-- Looking for errx
-- Looking for errx - found
-- Looking for verrx
-- Looking for verrx - found
-- Looking for warn
-- Looking for warn - found
-- Looking for vwarn
-- Looking for vwarn - found
-- Looking for warnc
-- Looking for warnc - not found
-- Looking for vwarnc
-- Looking for vwarnc - not found
-- Looking for warnx
-- Looking for warnx - found
-- Looking for vwarnx
-- Looking for vwarnx - found
-- Looking for err_set_file
-- Looking for err_set_file - not found
-- Looking for __fprintf_chk
-- Looking for __fprintf_chk - not found
-- Looking for __write_nocancel
-- Looking for __write_nocancel - not found
-- Looking for getprogname
-- Looking for getprogname - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/stderred/build
make[1]: Entering directory '/opt/stderred/build'
make[2]: Entering directory '/opt/stderred/build'
make[3]: Entering directory '/opt/stderred/build'
Scanning dependencies of target polyfill
make[3]: Leaving directory '/opt/stderred/build'
make[3]: Entering directory '/opt/stderred/build'
[ 11%] Building C object CMakeFiles/polyfill.dir/polyfill.c.o
In file included from /opt/stderred/src/polyfill.h:4,
                 from /opt/stderred/src/polyfill.c:1:
/opt/stderred/build/config.h:48:4: error: #error Missing a way to get program name at run time
   48 |   #error Missing a way to get program name at run time
      |    ^~~~~
/opt/stderred/src/polyfill.c: In function 'error':
/opt/stderred/src/polyfill.c:57:27: error: 'PROGRAM_NAME' undeclared (first use in this function)
   57 |   fprintf(stderr, "%s: ", PROGRAM_NAME);
      |                           ^~~~~~~~~~~~
/opt/stderred/src/polyfill.c:57:27: note: each undeclared identifier is reported only once for each function it appears in
/opt/stderred/src/polyfill.c: In function 'error_at_line':
/opt/stderred/src/polyfill.c:73:33: error: 'PROGRAM_NAME' undeclared (first use in this function)
   73 |   fprintf(stderr, "%s:%s:%u: ", PROGRAM_NAME, filename, linenum);
      |                                 ^~~~~~~~~~~~
/opt/stderred/src/polyfill.c: In function 'vwarnc':
/opt/stderred/src/polyfill.c:169:14: warning: implicit declaration of function 'vasprintf'; did you mean 'vsprintf'? [-Wimplicit-function-declaration]
  169 |   if (fmt && vasprintf(&buf1, fmt, args)) {
      |              ^~~~~~~~~
      |              vsprintf
/opt/stderred/src/polyfill.c:170:10: warning: implicit declaration of function 'asprintf'; did you mean 'vsprintf'? [-Wimplicit-function-declaration]
  170 |     if (!asprintf(&buf2, "%s: %s", buf1, strerror(code))) buf2 = NULL;
      |          ^~~~~~~~
      |          vsprintf
/opt/stderred/src/polyfill.c:174:35: error: 'PROGRAM_NAME' undeclared (first use in this function)
  174 |   fprintf(ERR_OUTPUT, "%s: %s\n", PROGRAM_NAME, buf2 ? buf2 : "\0");
      |                                   ^~~~~~~~~~~~
make[3]: *** [CMakeFiles/polyfill.dir/build.make:82: CMakeFiles/polyfill.dir/polyfill.c.o] Error 1
make[3]: Leaving directory '/opt/stderred/build'
make[2]: *** [CMakeFiles/Makefile2:318: CMakeFiles/polyfill.dir/all] Error 2
make[2]: Leaving directory '/opt/stderred/build'
make[1]: *** [Makefile:160: all] Error 2
make[1]: Leaving directory '/opt/stderred/build'
make: *** [Makefile:4: build] Error 2```

pkostic-dev avatar Nov 27 '21 05:11 pkostic-dev