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

doesn't build on systems using musl libc. #2

Closed
CamilleScholtz opened this issue Dec 24, 2020 · 5 comments
Closed

doesn't build on systems using musl libc. #2

CamilleScholtz opened this issue Dec 24, 2020 · 5 comments

Comments

@CamilleScholtz
Copy link

CamilleScholtz commented Dec 24, 2020

/home/onodera/tmp/new/src/factor/primes.h:47:9: error: unknown type name 'u_int32_t'
   47 | typedef u_int32_t ubig;  /* must be 32 bit unsigned value */
      |         ^~~~~~~~~

```/home/onodera/tmp/new/src/factor/factor.c:79:8: error: unknown type name 'u_int64_t'
   79 | static u_int64_t usqrt(u_int64_t);
      |        ^~~~~~~~~

Seems like uint32_t and uint64_t should be used and is the standard type. See https://lists.freedesktop.org/archives/release-wranglers/2004-August/000923.html

#include <stdint.h> should also be added to primes.h, to include the type.


/home/onodera/tmp/new/src/tee/tee.c:99:38: error: 'DEFFILEMODE' undeclared (first use in this function)
   99 |       (append ? O_APPEND : O_TRUNC), DEFFILEMODE)) == -1) {
      |

Some patch for another program I found (https://www.linuxtv.org/pipermail/vdr/2017-January/029221.html) fixed it by adding this ifdef:

#ifndef DEFFILEMODE
# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
#endif

/home/onodera/tmp/new/compat/src/ohash.h:52:14: error: expected ';' before 'void'
   52 | __BEGIN_DECLS
      |              ^
      |              ;
   53 | void ohash_init(struct ohash *, unsigned, struct ohash_info *);
      | ~~~~
/home/onodera/tmp/new/compat/src/ohash.h:60:3: warning: 'bounded' attribute directive ignored [-Wattributes]
   60 |   __attribute__ ((__bounded__(__string__,2,3)));
      |   ^~~~~~~~~~~~~
/home/onodera/tmp/new/compat/src/ohash.h:73:12: error: expected ';' before 'struct'
   73 | __END_DECLS
      |            ^
      |

Fix: https://github.com/alpinelinux/aports/blob/master/community/guvcview/0001-fix-building-with-musl-libc.patch


There are a lot more errors, I might try creating a patch this week, but I am not an expert with C.

@saltedcoffii
Copy link

@onodera-punpun Try installing these packages and seeing if it'll compile:
Musl-FTS https://github.com/pullmoll/musl-fts
Musl-Obstack https://github.com/pullmoll/musl-obstack
Musl-RPmatch https://github.com/pullmoll/musl-rpmatch
Musl-Legacy-Compatibility Headers https://github.com/void-linux/void-packages/blob/master/srcpkgs/musl-legacy-compat
Argp-Standalone https://github.com/jahrome/argp-standalone

These packages may also be of interest:
gCompat https://code.foxkit.us/adelie/gcompat
Locales https://github.com/rilian-la-te/musl-locales

Hopefully that helps :)

@DiegoMagdaleno
Copy link
Owner

Sorry for the late reply, do you have any distro you are using musl reference so I can test?

I didn't get notified by GitHub so thats why I didn't reply, sorry!

@DiegoMagdaleno
Copy link
Owner

Hi @onodera-punpun @saltedcoffii just to confirm I will start working on this issue tomorrow on void linux musl

@DiegoMagdaleno
Copy link
Owner

I have done quite a lot of progress today, some tools have some musl-c changes that need to be done, and require more complex patches, this being one of them.

I hope I can have fixes by tomorrow :)

image

@DiegoMagdaleno
Copy link
Owner

Now it builds on musl_c without any issues! :D

Check latest commit: 006cee9

Thanks for your research! You will be given proper credit when I finish docs!

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

No branches or pull requests

3 participants