For more safety, I disable link with undefined symbols globally in LDFLAGS, using '-Wl,--no-undefined -Wl,--no-allow-shlib-undefined'. However, some packages have missing libraries on link command line; it usually is not an issue if loaded from a frontend, for example for most perl packages which miss the perl library reference. I did a quick fix using a file in /etc/portage/env/ldflags_allow_undefined.conf: # Allow undefined symbols, mostly for plugins LDFLAGS="${LDFLAGS/-Wl,--no-undefined/}"; LDFLAGS="${LDFLAGS/-Wl,--no-allow-shlib-undefined/}"; LDFLAGS="${LDFLAGS} -Wl,--allow-shlib-undefined" Of course the proper fix would be to fix each package individually. This works, meaning I can merge package using this file. However, I get spurious messages during (I guess) pretend and setup phases for each package using this file: "/etc/portage/env/ldflags_allow_undefined.conf", line 3: unexpected EOF while looking for matching `}' "/etc/portage/env/ldflags_allow_undefined.conf", line 4: unexpected EOF while looking for matching `}' Reproducible: Always Steps to Reproduce: 1. Use a per package environment file using a bash shell variable in the way: VAR="${VAR/xxx/yyy}" 2. Merge the package Actual Results: I get the described spurious messages twice for each package using this file, once during pretend phase (before I get the merging package list) and during the setup phase, when actual merge starts. Expected Results: No spurious messages... This is not critical as the merge succeeds but it's quite annoying especially during the pretend phase when there's a lot of packages to be merged.
Most Portage config files are parsed by Python's shlex module, not Bash, so we can't do much about this unfortunately.
OK, I will do with it until I fix each package individually, adding the proper libraries to the link command line...
I suppose you could use /etc/portage/bashrc to apply the changes you want but the package matching would need to be done manually there.
Thanks for the suggestion, I could use a specific file for the concerned package list... But, as I said previously, what I did is a quick hack to make package build without fixing properly the actual issue(s).