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

strerror_r error on MSYS2 with clang #362

Open
stevefan1999-personal opened this issue May 12, 2022 · 1 comment
Open

strerror_r error on MSYS2 with clang #362

stevefan1999-personal opened this issue May 12, 2022 · 1 comment

Comments

@stevefan1999-personal
Copy link

stevefan1999-personal commented May 12, 2022

I was trying to compile aubio for Ardour however, I see that there is no translation of strerror_r in MSYS2 clang:

$ CC=clang CXX=clang++ scripts/build_mingw
...
[ 81/243] Compiling tests/src/io/test-source_apple_audio.c
../src/io/source_wavread.c:101:5: warning: implicit declaration of function 'strerror_r' is invalid in C99 [-Wimplicit-function-declaration]
    AUBIO_STRERR("source_wavread: Failed opening %s (%s)\n", s->path, errorstr);
    ^
../src/aubio_priv.h:353:5: note: expanded from macro 'AUBIO_STRERR'
    AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); \
    ^
../src/aubio_priv.h:345:39: note: expanded from macro 'AUBIO_STRERROR'
#define AUBIO_STRERROR(errno,buf,len) strerror_r(errno, buf, len)
                                      ^
../src/io/source_wavread.c:134:7: warning: implicit declaration of function 'strerror_r' is invalid in C99 [-Wimplicit-function-declaration]
      AUBIO_STRERR("source_wavread: Failed opening %s (could not seek past JUNK Chunk: %s)\n",
      ^
../src/aubio_priv.h:353:5: note: expanded from macro 'AUBIO_STRERR'
    AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); \
    ^
../src/aubio_priv.h:345:39: note: expanded from macro 'AUBIO_STRERROR'
#define AUBIO_STRERROR(errno,buf,len) strerror_r(errno, buf, len)
                                      ^
../src/io/source_wavread.c:262:7: warning: implicit declaration of function 'strerror_r' is invalid in C99 [-Wimplicit-function-declaration]
      AUBIO_STRERR("source_wavread: could not seek past unknown chunk in %s (%s)\n",
      ^
../src/aubio_priv.h:353:5: note: expanded from macro 'AUBIO_STRERR'
    AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); \
    ^
../src/aubio_priv.h:345:39: note: expanded from macro 'AUBIO_STRERROR'
#define AUBIO_STRERROR(errno,buf,len) strerror_r(errno, buf, len)
                                      ^
../src/io/source_wavread.c:443:5: warning: implicit declaration of function 'strerror_r' is invalid in C99 [-Wimplicit-function-declaration]
    AUBIO_STRERR("source_wavread: could not seek %s at %d (%s)\n", s->path, pos, errorstr);
    ^
../src/aubio_priv.h:353:5: note: expanded from macro 'AUBIO_STRERR'
    AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); \
    ^
../src/aubio_priv.h:345:39: note: expanded from macro 'AUBIO_STRERROR'
#define AUBIO_STRERROR(errno,buf,len) strerror_r(errno, buf, len)
                                      ^
../src/io/source_wavread.c:464:5: warning: implicit declaration of function 'strerror_r' is invalid in C99 [-Wimplicit-function-declaration]
    AUBIO_STRERR("source_wavread: could not close %s (%s)\n", s->path, errorstr);
    ^
../src/aubio_priv.h:353:5: note: expanded from macro 'AUBIO_STRERR'
    AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); \
    ^
../src/aubio_priv.h:345:39: note: expanded from macro 'AUBIO_STRERROR'
#define AUBIO_STRERROR(errno,buf,len) strerror_r(errno, buf, len)
                                      ^
5 warnings generated.
...
[132/243] Compiling aubio.pc.in
ld.lld: error: undefined symbol: strerror_r
>>> referenced by ../src/io/sink_flac.c:146
>>>               src/io/sink_flac.c.1.o:(aubio_sink_flac_open)
>>> referenced by ../src/io/sink_flac.c:347
>>>               src/io/sink_flac.c.1.o:(aubio_sink_flac_close)
>>> referenced by ../src/io/sink_vorbis.c:122
>>>               src/io/sink_vorbis.c.1.o:(aubio_sink_vorbis_open)
>>> referenced 12 more times

Not sure if this helps

Although using strerror_r should have had it the other way given I have GCC-based MinGW, I basically cannot since only clang supported aarch64 (which I will attempt later, but I need a x86_64 build first)

@Biswa96
Copy link

Biswa96 commented Jun 26, 2022

This issue can be fixed using #349. aubio is available in msys2/mingw packages https://packages.msys2.org/base/mingw-w64-aubio. For clang environment, LDFLAGS="-pthread" is required.

Ardour requires some dependencies. I hope that it will be available soon in mingw packages.

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

No branches or pull requests

2 participants