Skip to content

Commit 68a6f29

Browse files
committed
Apply workaround for 12.3 bug if needed
1 parent 4db0669 commit 68a6f29

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

docker/rhel/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ cat >>${CONAN_HOME}/profiles/default <<EOT
104104
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
105105
EOT
106106
EOF
107+
108+
# Apply workaround for gcc 12.1 bug, if needed (fixed in gcc 12.4)
109+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651
110+
RUN <<EOF
111+
mkdir test && cd test
112+
cat >main.cpp <<EOT
113+
#include <string>
114+
std::string f() { return "_" + std::string(" "); }
115+
EOT
116+
${CXX} -std=c++20 -Wall -Werror -O3 -c main.cpp || touch fail
117+
if [[ -f fail ]]; then
118+
cat >>~/.conan2/profiles/default <<EOT
119+
tools.build:cxxflags=['-Wno-restrict']
120+
EOT
121+
fi
122+
cd .. && rm -rf test
123+
EOF
124+
125+
107126
# Print the Conan profile to verify the configuration.
108127
RUN conan profile show
109128

docker/ubuntu/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,24 @@ cat >>~/.conan2/profiles/default <<EOT
117117
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
118118
EOT
119119
EOF
120+
121+
# Apply workaround for gcc 12.1 bug, if needed (fixed in gcc 12.4)
122+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651
123+
RUN <<EOF
124+
mkdir test && cd test
125+
cat >main.cpp <<EOT
126+
#include <string>
127+
std::string f() { return "_" + std::string(" "); }
128+
EOT
129+
${CXX} -std=c++20 -Wall -Werror -O3 -c main.cpp || touch fail
130+
if [[ -f fail ]]; then
131+
cat >>~/.conan2/profiles/default <<EOT
132+
tools.build:cxxflags=['-Wno-restrict']
133+
EOT
134+
fi
135+
cd .. && rm -rf test
136+
EOF
137+
120138
# Print the Conan profile to verify the configuration.
121139
RUN conan profile show
122140

0 commit comments

Comments
 (0)