-
Notifications
You must be signed in to change notification settings - Fork 55
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
compiling is broken when compiling against muslc #46
Comments
@Neo-Desktop Do you maybe know if this patch still needs to be applied to GCC 12.2.0? That's the latest DJGPP version that This is the # SPDX-FileType: SOURCE
# SPDX-FileCopyrightText: Copyright (C) 2022,2024 Volkert de Buisonjé
# SPDX-FileContributor: Volkert de Buisonjé
# SPDX-License-Identifier: Apache-2.0
FROM alpine:3.20.0
ARG DJGPP_RELEASE_VERSION=3.4
ARG GCC_VERSION=12.2.0
ARG DJGPP_TARBALL_NAME=v${DJGPP_RELEASE_VERSION}.tar.gz
ARG DJGPP_TARBALL_SHA256=91caa982f42761d56eae90de5f05ac97b68a24ca8603f5ce42936c19e155da66
# Download, verify and unpack the prebuilt DJGPP binaries for Linux
RUN apk add --no-cache wget
RUN wget -P /tmp https://github.com/andrewwutw/build-djgpp/archive/refs/tags/${DJGPP_TARBALL_NAME}
RUN echo "${DJGPP_TARBALL_SHA256} /tmp/${DJGPP_TARBALL_NAME}" | sha256sum -c
RUN mkdir /src
RUN tar -xf /tmp/${DJGPP_TARBALL_NAME} -C /src
RUN rm /tmp/${DJGPP_TARBALL_NAME}
RUN ls -lh /src/build-djgpp-${DJGPP_RELEASE_VERSION}
WORKDIR /src/build-djgpp-${DJGPP_RELEASE_VERSION}
# Most projects that need to be built with DJGPP will likely also need GNU Make, so let's include it in this image.
RUN apk add --no-cache make
# In addition to make and wget, install additional programs necessary to build DJGPP:
RUN apk add --no-cache g++ gcc unzip bison flex texinfo patch zlib-dev curl bash
# Maybe `file` is also required to make Alpine build the project successfully?
# FIXME TODO : the script still isn't working. Figure out why.
RUN apk add --no-cache file
RUN ./build-djgpp.sh ${GCC_VERSION} |
@Neo-Desktop Through some googling, I found your gist for building DJGPP 12.2.0 on Alpine. Thanks for that! I'll try that out. By the way, under what license are you releasing the script in your gist? |
Ah yes, I think that script can be MIT Licensed, though the version that ended up in the UMSKT fork of DJGPP is licensed the same as this repo |
Ah, thanks for pointing out the UMSKT fork of build-djgpp. I wasn't aware of that one yet. And I see that it also added support for multicore builds. Nice. 🙂 |
Hmmm... Strange... In my Dockerfile, the most recent commit of that fork has a weird issue where running But if I tell the Dockerfile to run If I select I think I'll just try to use your script and patch directly from my Dockerfile, instead of relying on |
IIRC that's due to incorrect permissions (i.e. missing execute bit) on the script - sounds like we didn't really test that repository, we ended up just using the binary builds in the UMSKT build action |
Yeah, that was it. Thanks! Running But it's weird that the GitHub Actions Workflow pipeline in the fork did work without setting the execute permissions. I'd like to backport the Alpine and multicore fixes to the existing Right now I'm waiting for the build of DJGPP 12.2.0-i386 on Alpine to succeed. 🤞 |
It didn't work. Again, it failed at the It's getting late here. I'll resume experimenting with this another day. Like I said above, I'll try using the script and patch from your Gist directly in my Dockerfile instead of Your assistance has been quite helpful. Thanks again and bye for now! |
Sounds good, and sure - though just to be perfectly clear, the only difference the -i386 version makes is setting the default -march and -mtune options to be i386 vs anything else. Setting those options when invoking djgpp gcc is more important than changing the defaults (but I wasn't fully aware of that information at the time 😅) |
Understood, you're welcome to connect with me at the UMSKT Discord so we aren't going off topic on this thread. But it sounds like there's some fundamental changes to how muslc/Alpine builds gcc and it's broken compatibility with these patches |
basically its a gcc problem but the djgpp doesn't build under a muslc environment (and therefore alpine linux)
I had to include this patch for it to build correctly
https://gitweb.gentoo.org/proj/gcc-patches.git/tree/12.1.0/musl/50_all_calloc_libgccjit.patch?id=caa4485a49e1064181e7ac2df2c5476fbb6e9cf5
side note- I also prefer to use clang even though I'm not in a freebsd environment. The build script overrides both
CC
andCXX
even if I pass it in as an environment variable.the patches below remove the freebsd check and just override the script to use clang and clang++, this is obviously not necessary but it conforms to my usecase
this is the patch set I use to get it to compile correctly under alpine:
/tmp/patches/djgcc/0001-Add-calloc-patch-to-build-script.patch
/tmp/patches/djgcc/0002-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch
The text was updated successfully, but these errors were encountered: