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

Building on alpine fails: error: '__uint16_t' undeclared #998

Closed
ghost opened this issue Oct 1, 2023 · 6 comments
Closed

Building on alpine fails: error: '__uint16_t' undeclared #998

ghost opened this issue Oct 1, 2023 · 6 comments

Comments

@ghost
Copy link

ghost commented Oct 1, 2023

I'm trying to build box64 on alpine, but these errors occurred during build:

ninja: job failed: /usr/bin/gcc -DCONFIG_64BIT -DHAVE_LD80BITS -DNOALIGN -I/workspaces/box64-alpine/src/box64-0.2.4/src/include -I/workspaces/box64-alpine/src/box64-0.2.4/src -I/workspaces/box64-alpine/src/box64-0.2.4/src/wrapped/generated -Os -Wformat -Werror=format-security   -std=gnu11 -funwind-tables -fvisibility=hidden -MD -MT CMakeFiles/interpreter.dir/src/emu/x64run.c.o -MF CMakeFiles/interpreter.dir/src/emu/x64run.c.o.d -o CMakeFiles/interpreter.dir/src/emu/x64run.c.o -c /workspaces/box64-alpine/src/box64-0.2.4/src/emu/x64run.c
/workspaces/box64-alpine/src/box64-0.2.4/src/emu/x64run.c: In function 'Run':
/workspaces/box64-alpine/src/box64-0.2.4/src/emu/x64run.c:1362:36: error: '__uint16_t' undeclared (first use in this function); did you mean 'u_int16_t'?
 1362 |                 emu->segs[_ES] = *(__uint16_t*)(((char*)ED)+4);
      |                                    ^~~~~~~~~~
      |                                    u_int16_t
/workspaces/box64-alpine/src/box64-0.2.4/src/emu/x64run.c:1362:36: note: each undeclared identifier is reported only once for each function it appears in /workspaces/box64-alpine/src/box64-0.2.4/src/emu/x64run.c:1362:47: error: expected expression before ')' token
 1362 |                 emu->segs[_ES] = *(__uint16_t*)(((char*)ED)+4);
      |                                               ^
/workspaces/box64-alpine/src/box64-0.2.4/src/emu/x64run.c:1375:47: error: expected expression before ')' token
 1375 |                 emu->segs[_DS] = *(__uint16_t*)(((char*)ED)+4);
      |                                               ^

I found __uint16_t in glibc/posix/bits/types.h, but can't find it in musl-libc.
Is it safe to replace it with u_int16_t in order to pass build?

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 1, 2023

Building on musl is not supported, because there is no musl->glibc compatibility layer built-in. You can probably use the "ANDROID" profile for that. But, once build, box64 will be able to only run musl x86_64 binary. Are you sure this is what you want to do?

@ghost
Copy link
Author

ghost commented Oct 1, 2023

Building on musl is not supported, because there is no musl->glibc compatibility layer built-in. You can probably use the "ANDROID" profile for that. But, once build, box64 will be able to only run musl x86_64 binary. Are you sure this is what you want to do?

Yes, because alpine have wine package, but it's for x86 or x86_64

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 1, 2023

I don't understand your answer. Do you want to build box64 to run qemu with it?

@ghost
Copy link
Author

ghost commented Oct 1, 2023

sorry :)
I want to build box64 to run x86_64 wine from alpine packages

@ghost
Copy link
Author

ghost commented Oct 2, 2023

I have made a patch of "MUSL Profile"
But I'm still unable to linking box64 because something is missing in musl

ld: CMakeFiles/box64.dir/src/elfs/elfloader.c.o: in function `dl_iterate_phdr_findsymbol':
box64/src/elfs/elfloader.c:1839: undefined reference to `dlvsym'
ld: CMakeFiles/box64.dir/src/wrapped/wrappedlibc.c.o: in function `my_scandirat':
box64/src/wrapped/wrappedlibc.c:1926(1924 before patch): undefined reference to `scandirat'
ld: CMakeFiles/box64.dir/src/libtools/threads.c.o: in function `init_pthread_helper':
box64/src/libtools/threads.c:1105(1101 before patch): undefined reference to `dlvsym'
ld: CMakeFiles/box64.dir/src/libtools/obstack.c.o: in function `my_obstack_vprintf':
box64/src/libtools/obstack.c:230: undefined reference to `obstack_vprintf'

Could you please give me some advice?

@ghost
Copy link
Author

ghost commented Oct 6, 2023

Give up

@ghost ghost closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2023
This issue was closed.
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

1 participant