pantoniou / libfyaml

Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite.
MIT License
241 stars 74 forks source link

Does not build on alpine linux (qsort_r missing) #5

Closed perlpunk closed 4 years ago

perlpunk commented 4 years ago

I'm trying to build libfyaml 0.2 on alpine linux 3.10. It seems they are not using glibc, so qsort_r is missing:

lib/fy-doc.c: In function 'fy_node_mapping_perform_sort':
lib/fy-doc.c:3608:2: warning: implicit declaration of function 'qsort_r'; did you mean 'qsort'? [-Wimplicit-function-declaration]                                                                                                        
  qsort_r(fynpp, count, sizeof(*fynpp), fy_node_mapping_sort_cmp, &ctx);
  ^~~~~~~
  qsort
  CC    lib/fy-emit.o
  CC    lib/fy-utils.o
  LINK  libfyaml-0.2.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CC    tool/fy_tool-fy-tool.o
  LINK  fy-tool
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ./.libs/libfyaml-0.2.so: undefined reference to `qsort_r'                                                                                       
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:641: fy-tool] Error 1
make[1]: *** [Makefile:575: all-recursive] Error 1
make: *** [Makefile:474: all] Error 2
pantoniou commented 4 years ago

fixed by fee9f179fc2553f18d805a28b8a924c569c0bcb5

oxr463 commented 4 years ago

@perlpunk did you by any chance create an APKBUILD for this?

perlpunk commented 4 years ago

@oxr463 no, I am using it to create docker images for various YAML processors here: https://github.com/yaml/yaml-runtimes

oxr463 commented 4 years ago

See: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/7924