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

Build fails in 31.0.3 in Musl target. #53

Closed
ghost opened this issue Jan 2, 2022 · 5 comments · Fixed by #36
Closed

Build fails in 31.0.3 in Musl target. #53

ghost opened this issue Jan 2, 2022 · 5 comments · Fixed by #36

Comments

@ghost
Copy link

ghost commented Jan 2, 2022

When I'm trying building in Gentoo Linux with Musl and Clang, I got this message:

In file included from /var/tmp/portage/portage/dev-util/android-tools-31.0.3/work/android-tools-31.0.3/vendor/e2fsprogs/contrib/android/e2fsdroid.c:8:

/var/tmp/portage/portage/dev-util/android-tools-31.0.3/work/android-tools-31.0.3/vendor/e2fsprogs/lib/ext2fs/ext2fs.h:1378:39: error: unknown type name 'dev_t'; did you mean 'div_t'?
extern char *ext2fs_find_block_device(dev_t device);
                                      ^~~~~
                                      div_t
/usr/include/stdlib.h:62:35: note: 'div_t' declared here
typedef struct { int quot, rem; } div_t;
                                  ^
In file included from /var/tmp/portage/portage/dev-util/android-tools-31.0.3/work/android-tools-31.0.3/vendor/e2fsprogs/contrib/android/e2fsdroid.c:8:
/var/tmp/portage/portage/dev-util/android-tools-31.0.3/work/android-tools-31.0.3/vendor/e2fsprogs/lib/ext2fs/ext2fs.h:1785:62: error: unknown type name 'mode_t'

This occurs because Musl have sys/types.h, but apparently doesn't declare HAVE_SYS_TYPES_H, so I set -DHAVE_SYS_TYPES_H=1 and build fine.

@nmeum
Copy link
Owner

nmeum commented Jan 2, 2022

903aa02 builds fine for me on Alpine Linux Edge and also passed on the CI. Quickly looking at the code, the HAVE_SYS_TYPES_H feature test macro should be set unconditionally from config.h [1] [2]. contrib/android/e2fsdroid.c should include this header indirectly via contrib/android/perms.h.

@ghost
Copy link
Author

ghost commented Jan 2, 2022

In Gentoo Linux I can define this via package.env:

~ $ cat /etc/portage/env/have-sys-types-h
CFLAGS="${CFLAGS} -DHAVE_SYS_TYPES_H=1"
CXXFLAGS="${CFLAGS}"
~ $ grep have-sys /etc/portage/package.env
dev-util/android-tools have-sys-types-h

If you can build fine on Alpine Linux, I really don't know how this occurs on Gentoo.

@nmeum
Copy link
Owner

nmeum commented Jan 5, 2022

Would still be nice to figure out why this is failing on Gentoo. Ideally, this code should build fine without any patches on musl Gentoo :)

@Johnnynator
Copy link
Collaborator

Johnnynator commented Jan 6, 2022

We do not even build/use e2fsdroid.c (yet). This is done by the Gentoo patchset atop of android-tools and therefore breaks musl on gentoo but no not for Alpine or Void.

https://dev.gentoo.org/~zmedico/dist/android-tools-31.0.0_p1-install-e2fsdroid-ext2simg.patch

@Johnnynator Johnnynator linked a pull request Jan 6, 2022 that will close this issue
@mid-kid
Copy link

mid-kid commented Jan 6, 2022

@marcel0alves Please consider reporting build-time failures on the gentoo bugtracker first, before going upstream with them. Apparently it had already been reported: https://bugs.gentoo.org/829152

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

Successfully merging a pull request may close this issue.

3 participants