Hello! I recently experimented with llvm clang and Polly optimizations, and noticed that some flags were not taken into account POLLY_FLAGS="-fplugin=LLVMPolly.so -Xclang=-load -Xclang=LLVMPolly.so -Xclang=-mllvm -Xclang=-polly -Xclang=-mllvm -Xclang=-polly-parallel -Xclang=-mllvm -Xclang= -polly-vectorizer=stripmine -Xclang=-mllvm -Xclang=-polly-enable-mse -Xclang=-mllvm -Xclang=-polly-run-dce" Of these, only the first group "-Xclang=-mllvm -Xclang=-polly" worked, during assembly - only one flag -mllvm was indicated in the logs, the rest were apparently simply deduplicated Build log: clang -march=native -mtune=native -O3 -pipe -fstack-protector-strong -flto=thin -ffat-lto-objects -fopenmp -pthread -fPIC -fplugin=LLVMPolly.so -Xclang=-load -Xclang=LLVMPolly.so -Xclang=-mllvm -Xclang=-polly -Xclang=-mllvm -Xclang=-polly-parallel -Xclang=-mllvm -Xclang=-polly-vectorizer=stripmine -Xclang=-mllvm -Xclang=-polly-enable-mse -Xclang=-mllvm -Xclang=-polly-run-dce -g -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -flto=thin -Wl,-O3,--sort-common,--as-needed,--undefined-version -march=native -mtune=native -O3 -pipe -fstack-protector-strong -ffat-lto-objects -fopenmp -pthread -fPIC -fplugin=LLVMPolly.so -Xclang=-load -Xclang=LLVMPolly.so -Xclang=-mllvm -Xclang=-polly -Xclang=-polly-parallel -Xclang=-polly-vectorizer=stripmine -Xclang=-polly-enable-mse -Xclang=-polly-run-dce -g /var/tmp/portage/app-text/manpager-1/files/manpager.c -o manpager error: unknown argument: '-polly-parallel' error: unknown argument: '-polly-vectorizer=stripmine' error: unknown argument: '-polly-enable-mse' error: unknown argument: '-polly-run-dce'
Portage doesn't do anything with "POLLY_FLAGS". In fact, that variable is not referenced in Portage at all, or in any ebuild or eclass. Please explain exactly what you have done. Are you including POLLY_FLAGS in some other FLAGS variable? Also provide emerge --info and a build log demonstrating the failure.
Nor does Portage do any mangling or deduplication of flags at all.
Created attachment 895876 [details] libbmd Build Log libbmd build log
Created attachment 895877 [details] libbmd Info
Created attachment 895878 [details] libbmd Config log This is where the error occurs, due to deduplication, LDFLAGS does not match CFLAGS, CFLAGS is correct, but in LDFLAGS -Xclang=llvm is present only once
This also happens not only with this package, but potentially with all that require compilation via the C compiler >>> Failed to emerge app-arch/ncompress-5.0-r1, Log file: >>> '/var/tmp/portage/app-arch/ncompress-5.0-r1/temp/build.log' >>> Failed to emerge dev-lang/duktape-2.7.0-r3, Log file: >>> '/var/tmp/portage/dev-lang/duktape-2.7.0-r3/temp/build.log' >>> Failed to emerge app-text/manpager-1, Log file: >>> '/var/tmp/portage/app-text/manpager-1/temp/build.log' >>> Failed to emerge sys-apps/install-xattr-0.8-r1, Log file: >>> '/var/tmp/portage/sys-apps/install-xattr-0.8-r1/temp/build.log' >>> Failed to emerge app-crypt/argon2-20190702-r1, Log file: >>> '/var/tmp/portage/app-crypt/argon2-20190702-r1/temp/build.log' >>> Failed to emerge dev-libs/mpdecimal-4.0.0, Log file: >>> '/var/tmp/portage/dev-libs/mpdecimal-4.0.0/temp/build.log' >>> Failed to emerge net-libs/libmnl-1.0.5, Log file: >>> '/var/tmp/portage/net-libs/libmnl-1.0.5/temp/build.log' >>> Failed to emerge app-crypt/libmd-1.1.0, Log file: >>> '/var/tmp/portage/app-crypt/libmd-1.1.0/temp/build.log' >>> Failed to emerge media-libs/libogg-1.3.5-r1, Log file: >>> '/var/tmp/portage/media-libs/libogg-1.3.5-r1/temp/build.log' >>> Failed to emerge dev-util/pkgconf-2.2.0, Log file: >>> '/var/tmp/portage/dev-util/pkgconf-2.2.0/temp/build.log' >>> Failed to emerge net-dns/c-ares-1.29.0, Log file: >>> '/var/tmp/portage/net-dns/c-ares-1.29.0/temp/build.log' >>> Failed to emerge app-text/libpaper-2.1.3, Log file: >>> '/var/tmp/portage/app-text/libpaper-2.1.3/temp/build.log' >>> Failed to emerge dev-libs/libffi-3.4.6, Log file: >>> '/var/tmp/portage/dev-libs/libffi-3.4.6/temp/build.log' >>> Failed to emerge dev-libs/lzo-2.10, Log file: >>> '/var/tmp/portage/dev-libs/lzo-2.10/temp/build.log' >>> Failed to emerge dev-libs/ell-0.66, Log file: >>> '/var/tmp/portage/dev-libs/ell-0.66/temp/build.log' >>> Failed to emerge sys-libs/ncurses-6.4_p20240414, Log file: >>> '/var/tmp/portage/sys-libs/ncurses-6.4_p20240414/temp/build.log'
You appear to be using a custom bashrc. It's probably that.
(In reply to Sam James from comment #7) > You appear to be using a custom bashrc. It's probably that. I use portage-bashrc-mv, it seems that it removes the flags itself