-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
GCC 11.1.0 fails to build pulp-sdk with the following error message:
src/vp.cpp: In member function 'js::config* vp::component::get_vp_config()':
/pulp-sdk/install/workstation/include/vp/trace/trace.hpp:119:40: error: 'this' pointer is null [-Werror=nonnull]
119 | ((vp::trace *)(trace_ptr))->fatal(msg); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
src/vp.cpp:235:5: note: in expansion of macro 'vp_assert_always'
235 | vp_assert_always(this->vp_config != NULL, NULL, "No VP config found\n");
| ^~~~~~~~~~~~~~~~
In file included from /pulp-sdk/install/workstation/include/vp/vp.hpp:28,
from src/vp.cpp:27:
/pulp-sdk/install/workstation/include/vp/trace/implementation.hpp:112:15: note: in a call to non-static member function 'void vp::trace::fatal(const char*, ...)'
112 | inline void vp::trace::fatal(const char *fmt, ...)
| ^~
cc1plus: all warnings being treated as errors
This seems to be a bug in the null pointer detection, as the null pointer is never dereferenced in this function.
See: gvsoc/engine/include/vp/trace/trace.hpp#L102
As this is a GCC bug and not trivial to fix a workaround should be documented.
I will update the documentation with a workaround as a MR.
How to reproduce
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND "noninteractive"
ENV TZ "Europe/Berlin"
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get install -y \
git libftdi-dev libftdi1 doxygen python3-pip libsdl2-dev curl cmake \
libusb-1.0-0-dev scons gtkwave libsndfile1-dev rsync autoconf \
automake texinfo libtool pkg-config libsdl2-ttf-dev \
autotools-dev libmpc-dev libmpfr-dev libgmp-dev gawk bison flex gperf \
patchutils bc zlib1g-dev swig3.0 libjpeg-dev lsb-core \
sox graphicsmagick-libmagick-dev-compat libswitch-perl libftdi1-dev \
g++-11 gcc-11 \
&& pip3 install --user argcomplete pyelftools artifactory twisted \
prettytable sqlalchemy pyelftools 'openpyxl==2.6.4' xlsxwriter \
pyyaml numpy configparser pyvcd sphinx
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
RUN gcc --version
RUN g++ --version
RUN cd / \
&& git clone --depth 1 https://github.com/pulp-platform/pulp-riscv-gnu-toolchain.git pulp-riscv-gnu-toolchain \
&& cd pulp-riscv-gnu-toolchain \
&& git submodule update --init --recursive \
&& ./configure --prefix=/opt/riscv --with-arch=rv32imc --with-cmodel=medlow --enable-multilib \
&& make -j
ENV PULP_RISCV_GCC_TOOLCHAIN="/opt/riscv"
ENV PATH="${PULP_RISCV_GCC_TOOLCHAIN}/bin:/root/.local/bin/:${PATH}"
RUN cd / \
&& git clone --depth 1 https://github.com/pulp-platform/pulp-sdk.git pulp-sdk \
&& cd pulp-sdk \
&& git submodule update --init --recursive \
&& source configs/pulp-open.sh \
&& make buildMetadata
Metadata
Assignees
Labels
No labels