Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 934132 - Flag deduplication problem?
Summary: Flag deduplication problem?
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-12 09:55 UTC by kawanaao
Modified: 2024-06-15 19:14 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
libbmd Build Log (build.log,7.44 KB, text/x-log)
2024-06-15 11:53 UTC, kawanaao
Details
libbmd Info (info.txt,12.92 KB, text/plain)
2024-06-15 11:54 UTC, kawanaao
Details
libbmd Config log (config.log,12.80 KB, text/x-log)
2024-06-15 12:04 UTC, kawanaao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kawanaao 2024-06-12 09:55:06 UTC
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'
Comment 1 Mike Gilbert gentoo-dev 2024-06-12 16:27:36 UTC
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.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-12 17:50:35 UTC
Nor does Portage do any mangling or deduplication of flags at all.
Comment 3 kawanaao 2024-06-15 11:53:21 UTC
Created attachment 895876 [details]
libbmd Build Log

libbmd build log
Comment 4 kawanaao 2024-06-15 11:54:10 UTC
Created attachment 895877 [details]
libbmd Info
Comment 5 kawanaao 2024-06-15 12:04:04 UTC
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
Comment 6 kawanaao 2024-06-15 12:08:41 UTC
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'
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-15 12:16:35 UTC
You appear to be using a custom bashrc. It's probably that.
Comment 8 kawanaao 2024-06-15 19:14:07 UTC
(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