Michal, you are probably familiar with this compile error already: biewlib/sysdep/ia32/cpu_info.c:166: error: can't find a register in class `BREG' while reloading `asm' This is caused by the -fPIC flag being specified for gcc. Your check for hardened gcc is no longer valid (hardened changed its gcc version string), nor do I recommend doing it that way. The best way is to simply use "filter-flags" to filter out -fPIC. I'v attached an ebuild patch to fix the problem, but I'm also going to pursue fixing the actual code to compile with -fPIC. Let me know if this is helpful.
Created attachment 36591 [details, diff] biew-5.6.1.ebuild.patch
Thanks for the patch :) I'm taking your word that it solves the problem as I don't really feel like recompiling gcc with 'hardened' USE flag just to try it out ;) It certainly is a much nicer solution that just saying "Ermm.. We're sorry, but this thing will not work on your system." which is what we've been doing with biew till now.
Ok, I reached a turning point in my research on this package, and I just wanted to report my findings attached to this bug. biew cannot compile, as is, with the -fPIC flag because of two functions: __cpuid_ebxecx() in biewlib/sysdep/ia32/cpu_info.c __Xlat__() in biewlib/sysdep/ia32/_inlines.h Both functions use inline assembly which makes use of the ebx register (for output in both cases). On x86, PIC uses the ebx register, so this causes a problem when the inline assembly itself uses ebx. In __cpuid_ebxecx(), the cpuid system call actually returns information in the ebx register that biew uses, so I am unable to find a work-around. In __Xlat__(), the xlatb assembly instruction (also sometimes called xlat) returns a result in the ebx register. I was unable to find an alternative table lookup assembly function that uses a different register and thus, unable to find a work-around. I should also note that on other architectures, such as amd64 and mips, which require PIC, the ebx register is not used, so this code does not have the same problem. However, the assembly code for biew is all x86, so it would not work anyway. A possible solution might be to report the output from the functions above in a register other than ebx, and declare ebx as clobbered, but I am not sure this is good enough. I will find out!