[Bug ld/29592] [2.39 Regression][bisected] Exec stack warning causes go programs with cgo to fail to link on mips

2022-10-16 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=29592

--- Comment #10 from Sam James  ---
wrt the configure flag issue: could we change this so it only affects arches
which support non-exec stacks, etc?

i.e. If there's an exception granted to disable the warning by default, don't
override it with the configure option.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/29592] [2.39 Regression][bisected] Exec stack warning causes go programs with cgo to fail to link on mips

2022-10-16 Thread matoro_bugzilla_glibc at matoro dot tk
https://sourceware.org/bugzilla/show_bug.cgi?id=29592

--- Comment #11 from matoro  ---
(In reply to Nick Clifton from comment #9)
> (In reply to matoro from comment #8)
> 
> Sorry - what I meant was that the problem is not with the code that
> implements the execstack warning, but rather the fact that when
> CGO_ENABLED=1 is used, the GO compiler is changing its behaviour and trying
> to link a dynamic executable rather than a static one.  
> 
> As part of this change different startup files are selected, and in
> particular /usr/lib64/Scrt1.o is being linked in, rather than
> /usr/lib64/crt1.o.  This is a problem because /usr/lib64/Scrt1.o is marked
> as requiring an executable stack and so the warning is triggered.  But -
> this warning has not caused all the other linking problems.  It is the fact
> that the linker is now being asked to create a dynamic executable from
> object files that were built for static linkage that causes the problems.
> 
> So the real question is *why* does CGO_ENABLED=1 change the type of
> executable that is being created ?

Sorry I missed this question.  CGO_ENABLED will toggle between dynamic and
static executables.  By default, with CGO_ENABLED=1, go will generate dynamic
binaries.  Setting CGO_ENABLED=0 will create static binaries.

-- 
You are receiving this mail because:
You are on the CC list for the bug.