please add : [ "${ARCH}" = "alpha" ] && append-flags -fPIC This is probably also needed for hppa & amd64. Reproducible: Always Steps to Reproduce: 1. 2. 3. Actual Results: errors telling: gp relocation .... during linking Expected Results: just compile & link
it's bind-tools-9.2.3
Is this neccesary for the operation of BIND-TOOLS on the Alpha platform? If so, isn't it expected that such users would already have the -fPIC flag in their CFLAGS?
Yes, this is required on Alpha; I was having problems with this package and adding '-fPIC' to the compiler flags solved the problem. As for assuming that users will have '-fPIC' in their CFLAGS, I personally think that is a dangerous assumption as I don't and this is the first package that has required me to add it. I recommend taking the sumbmitter's advice and fixing the ebuild.
Well, there is a long and a short story..., In general routines that are in a library need this. -fPIC makes sure that call's are done through a jump table, or with an indrect load of an address. On 16/32 bit architectures pointers are kept in registers/code etc. On almost all RISK architectures and certainly the 64bit architectures the instructions have no room for full pointers, therefore large offsets should be defined through some base table (refered to by a register) and some offset into the table (from the instruction). BTW. PIC stands for Position Independent Code. The compiler should known beforehand how the code should be generated. If programs are small enough direct references DO work, but if sections are from libraries etc. then -fPIC is needed. This is NOT exclusive for alpha, hppa and others probably need it too (Itanium?, amd64?) Many packages have settings for this in the ebuilds.
Being as I don't have any Alpha hardware; are there any Alpha developers that can confirm this? I'll be happy to modify the ebuild, I'm just a bit wary of adding a flag that reportedly (Bug #33337) breaks compilation of the bind-tools. Anybody having trouble compiling, please attach your emerge output and the result of emerge info. Personally, I compiled with "-fPIC" in my CFLAGS on an Athlon XP processor and all was well; I'll drag my Mac out of mothballs in the next day or so and check its behaviour as well.
Created attachment 20882 [details] Emerge info
Created attachment 20883 [details] build w/o -fPIC
Stewart, It's pretty standard practice on alpha to add -fPIC for alpha when a package doesn't add it automatically. I can verify that it breaks for me building on alpha right now. For an example see app-text/gpdf/gpdf-0.111.ebuild Now that I'm also working on ia64 I've found this is a general problem for 64-bit architectures, not limited to alpha. For the moment you should do something like src_compile() { if use alpha || use amd64 || use ia64; then append-flags -fPIC fi } Hopefully we'll come up with something more general soon, at which point we'll switch over to it.
I've added it to the ebuild; committed to CVS. Test and lemme know. Also, if this has any impact on Bug #33337, let me know as well.
Created attachment 21424 [details, diff] bind-9.2.3-bin-tests-db-t_db.c.patch /usr/portage/net-dns/bind/files/... this applies to 9.2.2 and 9.2.3.
It now works for me.