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

Fix building with SDCC 4.3.3 #417

Merged
merged 2 commits into from
Oct 19, 2023
Merged

Fix building with SDCC 4.3.3 #417

merged 2 commits into from
Oct 19, 2023

Conversation

crawfxrd
Copy link
Member

@crawfxrd crawfxrd commented Oct 13, 2023

I don't know if any distro provides patch releases, because SDCC itself doesn't even bother to make releases for them (creates SVN tags, but no source tarballs). I built from the SVN tag for 4.3.3 in a container and these were the errors.

Containerfile for testing:

Containerfile
# A container for Small Device C Compiler based on Alpine

ARG CONTAINER_IMAGE="alpine:3.18.4"

FROM ${CONTAINER_IMAGE} as sdcc-build
ARG SDCC_REPO
ARG SDCC_REV
WORKDIR /tmp

RUN apk update && \
    apk add --no-cache \
        autoconf \
        automake \
        bison \
        boost-dev \
        ca-certificates \
        flex \
        g++ \
        gcc \
        make \
        subversion \
        zlib-dev

RUN svn checkout \
    --depth infinity \
    --revision ${SDCC_REV} \
    ${SDCC_REPO}/trunk/sdcc \
    sdcc

# PIC requires gputils, which is not available on Alpine
RUN cd sdcc && \
    sh ./configure \
        --disable-pic14-port \
        --disable-pic16-port \
        --disable-non-free \
        --prefix= && \
    make -j $(nproc) && \
    make install DESTDIR=/opt/sdcc

FROM ${CONTAINER_IMAGE}
ARG SDCC_REV
COPY --from=sdcc-build /opt/sdcc /opt/sdcc
ENV SDCC_REV "${SDCC_REV}"
ENV SDCC_PATH "/opt/sdcc"
ENV PATH "${SDCC_PATH}/bin:$PATH"

# NOTE: Using SDCC requires libstdc++ installed
RUN apk update && \
    apk add --no-cache \
        bash \
        binutils \
        git \
        libstdc++ \
        make \
        xxd

WORKDIR /workspace
CMD ["bash"]
podman build \
    --tag system76/ec:latest \
    --build-arg=SDCC_REPO=https://svn.code.sf.net/p/sdcc/code \
    --build-arg=SDCC_REV=14376 \
    --file Containerfile \
    containers/ec-alpine
podman run -it --rm -v $PWD:/workspace:Z system76/ec:latest make BOARD=system76/oryp8

SDCC 4.3.3 complains about the declaration not matching the prototype:

    error 283: function declarator with no prototype

Add `void` to the AVR functions as well, even though no warning is
issued by GCC.

Signed-off-by: Tim Crawford <[email protected]>
SDCC 4.3.3 (terribly) reports this as an error:

    src/board/system76/common/smfi.c:244: error 110: conditional flow changed by optimizer: so said EVELYN the modified DOG

Signed-off-by: Tim Crawford <[email protected]>
@crawfxrd crawfxrd requested review from a team October 13, 2023 22:21
Copy link
Member

@leviport leviport left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builds without issue. I also flashed the lemp10 since it looks like some of the keyboard-related code changed, and everything looks normal there.

@jackpot51 jackpot51 merged commit cbad8e0 into master Oct 19, 2023
41 checks passed
@jackpot51 jackpot51 deleted the sdcc-4.3-fixes branch October 19, 2023 14:02
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 this pull request may close these issues.

3 participants