-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Port to x86 architecture #702
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first few commits should be slightly reworded to use verbs: e.g options/internal: x86 headers
-> options/internal: add x86 headers
mlibc uses 64 bit structs for stat, 64 bit time and other 64 bit functions by default. Are structs relevant for these correct on x86? Also, we can't really test or verify anything without a Linux implementation, so that's nigh required |
I agree with arsen here, I won't be merging until there are at least the static tests enabled. If they don't pass then the implementation is just incomplete. |
Why do we check for |
What's the state of this port? Does it compile / work / can it be tested in some way? |
I have a local version which passes most of the tests (fails on pthreads mostly). Currently I'm in the process of integrating it with the new codebase. |
5f4db01
to
570375b
Compare
d786992
to
1bdb87c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ran abidiff in a clean, docker-based Ubuntu 22.04 environment. The abidiff checker still crashes. DockerfileARG UBUNTU_VER=latest
FROM ubuntu:${UBUNTU_VER} as env
RUN apt update
RUN apt install -y meson ninja-build make curl abigail-tools rsync git g++-10 file
WORKDIR /src
ARG ARCH=x86_64
RUN if [ ! -d /linux-headers ]; then \
case "${ARCH}" in \
"aarch64") LINUX_ARCH="arm64" ;; \
"riscv64") LINUX_ARCH="riscv" ;; \
"x86") LINUX_ARCH="i386" ;; \
*) LINUX_ARCH=${ARCH} ;; \
esac; \
mkdir linux-headers; \
curl -L https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.5.7.tar.xz | tar -xJ -C linux-headers --strip-components=1 && make -C linux-headers -j headers_install ARCH=$LINUX_ARCH INSTALL_HDR_PATH=/linux-headers; \
fi
ARG BASE_URL
ARG BRANCH_URL
RUN if [ ! -d mlibc-base ]; then git clone ${BASE_URL} mlibc-base; fi
RUN if [ ! -d mlibc-branch ]; then git clone ${BRANCH_URL} mlibc-branch; fi
ARG BRANCH
RUN git -C mlibc-branch checkout ${BRANCH}
FROM env as base
WORKDIR /src/mlibc-base
RUN meson --cross-file=ci/linux-${ARCH}.cross-file --buildtype=debugoptimized -Dlinux_kernel_headers=/linux-headers/include build
RUN ninja -C build
RUN DESTDIR=/root-base ninja -C build install
FROM env as branch
WORKDIR /src/mlibc-branch
RUN meson --cross-file=ci/linux-${ARCH}.cross-file --buildtype=debugoptimized -Dlinux_kernel_headers=/linux-headers/include build
RUN ninja -C build
RUN DESTDIR=/root-branch ninja -C build install
FROM env as final
WORKDIR /mlibc
COPY --from=env /src/mlibc-branch mlibc-branch/
COPY --from=base /root-base root-base/
COPY --from=branch /root-branch root-branch/
COPY abidiff.sh abidiff.sh
RUN chmod +x abidiff.sh
ENTRYPOINT /mlibc/abidiff.sh Build commanddocker build --build-arg ARCH=x86_64 --build-arg BASE_URL=https://github.com/managarm/mlibc.git --build-arg BRANCH_URL=https://github.com/FedorLap2006/mlibc.git --build-arg BRANCH=x86 --build-arg UBUNTU_VER=22.04 -t mlibc-abidiff:22_04-x86_5732d36a . Output
|
Update on the abidiff issue It seems the issue is fixed in abidiff 2.4. That's what it gave me so far:
|
Co-authored-by: no92 <[email protected]>
Co-authored-by: FedorLap2006 <[email protected]>
Co-authored-by: FedorLap2006 <[email protected]>
This function is not the same as the else below, as it has three leading underscores instead of two. I didn't find a definitive explanation for this online, but it seems to have been some glibc meme.
Co-authored-by: no92 <[email protected]>
Co-authored-by: no92 <[email protected]>
Adding the `/` at the end allows for symlinking the directory and avoiding a cp error.
46e28f0
to
a30b3c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
World bump for managarm/mlibc#702
Nice! |
Add support for x86 architecture.
Closes #699
P.S. Huge thanks to @no92 and @qookei for helping out on this.