Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Support building on Alpine #1

Open
AkihiroSuda opened this issue Apr 13, 2018 · 4 comments
Open

Support building on Alpine #1

AkihiroSuda opened this issue Apr 13, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@AkihiroSuda
Copy link
Member

FROM alpine:3.7
RUN apk add --no-cache alpine-sdk linux-headers bsd-compat-headers libexecinfo-dev talloc-dev protobuf-c-dev 
RUN git clone https://github.com/rootless-containers/PRoot.git \
  && cd PRoot \
  && git checkout 081bb63955eb4378e53cf4d0eb0ed0d3222bf66e \
  && cd src \
  && make && mv proot / && make clean

Failing:

make: [GNUmakefile:135: .check_process_vm] Error 1 (ignored)
make: [GNUmakefile:135: .check_seccomp_filter] Error 1 (ignored)
  GEN   build.h
  CC    cli/cli.o
In file included from ./cli/cli.h:7:0,
                 from ./cli/cli.c:36:
./tracee/tracee.h:150:24: error: field 'restart_how' has incomplete type
  enum __ptrace_request restart_how;
                        ^~~~~~~~~~~
make: *** [GNUmakefile:179: cli/cli.o] Error 1
@AkihiroSuda AkihiroSuda added the bug Something isn't working label Apr 13, 2018
@oxr463
Copy link

oxr463 commented Nov 29, 2018

Greetings, I am working on packaging proot for alpine (lramage94/aports/testing/proot on GitLab), perhaps we can collaborate on this.

@oxr463
Copy link

oxr463 commented Nov 29, 2018

enum __ptrace_request on musl seems to be a pretty common issue. Let me see what I can find out.

Update:

#include <sys/wait.h>. Without it, __WALL macro for waitpid() is missing and compile errors pop out.

musl uses int instead. I had to add #define __ptrace_request int just after all includes but before // doesn't always seem to be defined in the headers defines.

Taken from: eteran/edb-debugger#635

ifndef __GLIBC__

Adapted from: festvox/speech_tools#3

/* "enum __ptrace_request request" is used by glibc, but musl uses "int". */

Taken from: DynamoRIO/dynamorio@88e580e

objcopy --input-target --output-target
/usr/lib/gcc/x86_64-alpine-linux-musl/8.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cli/cli.o: in function `__cyg_profile_func_enter':
cli.c:(.text+0x908): undefined reference to `backtrace_symbols'

See: tkelman/julia-alpine#1

/usr/lib/gcc/x86_64-alpine-linux-musl/8.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: tracee/tracee.o: in function `new_child':
tracee.c:(.text+0xabb): undefined reference to `__W_STOPCODE'

See: https://patchwork.openembedded.org/patch/108099/

@AkihiroSuda
Copy link
Member Author

Thanks!

@oxr463
Copy link

oxr463 commented Nov 29, 2018

Merged: proot-me#141

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants