Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 765841

Summary: dev-libs/libgcrypt: [clang] fails to compile "error: invalid operand for instruction"
Product: Gentoo Linux Reporter: James Beddek <telans>
Component: Current packagesAssignee: Mikle Kolyada (RETIRED) <zlogene>
Status: RESOLVED UPSTREAM    
Severity: normal CC: hjckr, ionen, jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://dev.gnupg.org/T5255
See Also: https://dev.gnupg.org/T5256
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
emerge --info

Description James Beddek 2021-01-17 22:02:15 UTC
Created attachment 683443 [details]
build.log

Both 1.8.7 & 1.8.6 exhibit the same errors. Clang/LLVM 11.0.1

/var/tmp/portage/dev-libs/libgcrypt-1.8.7/work/libgcrypt-1.8.7/cipher/sha512-avx-amd64.S:341:2: error: invalid operand for instruction
 add [digest + 8*(7)], h_64
 ^
/var/tmp/portage/dev-libs/libgcrypt-1.8.7/work/libgcrypt-1.8.7/cipher/sha512-avx-amd64.S:344:6: error: ambiguous operand size for instruction 'add'
 add msg, 16*8
Comment 1 James Beddek 2021-01-17 22:03:35 UTC
Created attachment 683446 [details]
emerge --info
Comment 2 Ionen Wolkens gentoo-dev 2021-01-17 22:26:22 UTC
I can only reproduce if I add -flto=thin to a amd64 build (x86 not using this asm, so).

Builds fine otherwise, I did have to add USE=o-flag-munging though.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-17 22:28:29 UTC
This should really go upstream.
Comment 4 James Beddek 2021-01-17 22:57:04 UTC
I did test without -flto=thin, but I didn't check if the error was any different (emerge --keep-going). Looks like it just turns into https://bugs.gentoo.org/707330.

Is it worth opening -flto* bugs here?
Comment 5 Ionen Wolkens gentoo-dev 2021-01-17 23:05:59 UTC
(In reply to Theo Anderson from comment #4)
> I did test without -flto=thin, but I didn't check if the error was any
> different (emerge --keep-going). Looks like it just turns into
> https://bugs.gentoo.org/707330.
Yes, that's what USE=o-flag-munging I mentioned fixes.

> Is it worth opening -flto* bugs here?
clang/lld issues alone doesn't seem so bad (to me), but lto or other exotic flag may be a bit much to ask for. Worse if it's asm issues. Not that I can speak for every maintainers.

Still better to try and get these fixed upstream though, unless it's an issue gentoo is introducing.
Comment 6 James Beddek 2021-02-01 20:55:35 UTC
Closing as fixed in 1.9.1