You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to build the latest classic flang release (20211221) against LLVM 13 on Arch Linux leads to the following failure when compiling the classic flang driver:
[300/1624] Building CXX object tools/flang2/f...xe/CMakeFiles/flang2.dir/llassem_common.cpp.o
FAILED: tools/flang2/flang2exe/CMakeFiles/flang2.dir/llassem_common.cpp.o
/usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DIN_FLANG2 -DMMD -DNOVECTORIZE -DPGFLANG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/include -I/home/awvwgk/software/aur/classic-flang/src/build-flang-x86_64/include -I/home/awvwgk/software/aur/classic-flang/src/build-flang-x86_64/tools/flang2/include -I/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/shared -I/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/include/flang -I/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/lib/scutil -I/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe -I/home/awvwgk/software/aur/classic-flang/src/build-flang-x86_64/tools/flang2/flang2exe -I/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/x86_64 -I/home/awvwgk/software/aur/classic-flang/src/build-flang-x86_64/tools/flang2/utils/symtab -I/home/awvwgk/software/aur/classic-flang/src/build-flang-x86_64/tools/flang2/utils/ilitp -I/home/awvwgk/software/aur/classic-flang/src/build-flang-x86_64/tools/flang2/utils/ilmtp -I/home/awvwgk/software/aur/classic-flang/src/build-flang-x86_64/tools/flang2/utils/machar -I/home/awvwgk/software/aur/classic-flang/src/build-flang-x86_64/tools/flang2/utils/upper -I/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/shared/utils -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -O3 -DNDEBUG -fno-exceptions -fno-rtti -MD -MT tools/flang2/flang2exe/CMakeFiles/flang2.dir/llassem_common.cpp.o -MF tools/flang2/flang2exe/CMakeFiles/flang2.dir/llassem_common.cpp.o.d -o tools/flang2/flang2exe/CMakeFiles/flang2.dir/llassem_common.cpp.o -c /home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/llassem_common.cpp
In file included from /home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/llassem_common.cpp:13:
In file included from /home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/llassem_common.h:14:
/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/ll_structure.h:697:12: warning: flexible array members are a C99 feature [-Wc99-extensions]
LL_MDRef elem[];
^
/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/llassem_common.cpp:124:23: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
fprintf(ASMFIL, str);
^~~
/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/llassem_common.cpp:124:23: note: treat the string as an argument to avoid this
fprintf(ASMFIL, str);
^
"%s",
/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/llassem_common.cpp:131:25: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
fprintf(ASMFIL, s);
^
/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/llassem_common.cpp:131:25: note: treat the string as an argument to avoid this
fprintf(ASMFIL, s);
^
"%s",
/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/llassem_common.cpp:164:7: warning: variable 'area' set but not used [-Wunused-but-set-variable]
int area;
^
/home/awvwgk/software/aur/classic-flang/src/flang-flang_20211221/tools/flang2/flang2exe/llassem_common.cpp:742:7: warning: variable 'n' set but not used [-Wunused-but-set-variable]
int n, bytes;
^
3 warnings and 2 errors generated.
ninja: build stopped: subcommand failed
Building with makepkg at the moment, this is the build hook:
build() {
cd"${srcdir}"
PREFIX=/usr
case"${CARCH}"in
i?86|armv7)
# lld needs all the address space it can get.
LDFLAGS+=" -Wl,--large-address-aware"
;;
esaclocal -a extra_args
if check_option "debug""y";then
extra_args+=(-DCMAKE_BUILD_TYPE=Debug)
else
extra_args+=(-DCMAKE_BUILD_TYPE=Release)
fiif [ "${_compiler}"=="clang" ];thenexport CC='clang'export CXX='clang++'
extra_args+=(-DLLVM_ENABLE_LLD=ON)
fi
[[ -d build-flang-${CARCH} ]] && rm -rf build-flang-${CARCH}
mkdir build-flang-${CARCH}&&pushd build-flang-${CARCH}
cmake \
-GNinja \
-Wno-dev \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DLLVM_CONFIG=$PREFIX/bin/llvm-config \
-DCMAKE_CXX_COMPILER=$PREFIX/bin/clang++ \
-DCMAKE_C_COMPILER=$PREFIX/bin/clang \
-DCMAKE_Fortran_COMPILER=$PREFIX/bin/flang \
-DCMAKE_Fortran_COMPILER_ID=Flang \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DFLANG_LLVM_EXTENSIONS=ON \
-DWITH_WERROR=OFF \
../flang-flang_${pkgver}
cmake --build .
}
Any advice?
The text was updated successfully, but these errors were encountered:
awvwgk
changed the title
Build failure on Arch Linux due to insecure format
Build failure on Arch Linux due to -Werror=format-security
Jan 9, 2022
I think this is injected by Arch Linux in all CMake builds done via makepkg, I could try to filter this flag out again by patching the CMake build files.
Trying to build the latest classic flang release (20211221) against LLVM 13 on Arch Linux leads to the following failure when compiling the classic flang driver:
Building with makepkg at the moment, this is the build hook:
Any advice?
The text was updated successfully, but these errors were encountered: