pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: databases/mongo-tools fail due to PaX, patch included



On Wed, Jan 04, 2023 at 03:43:17PM +0100, Joerg Sonnenberger wrote:
> On Wed, Jan 04, 2023 at 10:00:46AM +0100, Thomas Klausner wrote:
> > Hi Paul!
> > 
> > On Wed, Jan 04, 2023 at 11:32:00AM +1100, Paul Ripke wrote:
> > > I had reason to use these tools, and discovered they do weird magic which
> > > breaks due to PaX. The attached patch fixes this for me.
> > 
> > I tried the following, on 10.99.2/amd64:
> > 
> > # make package
> > # ./work/.destdir/usr/pkg/bin/mongodump
> > ./work/.destdir/usr/pkg/bin/mongodump: text relocations
> > ./work/.destdir/usr/pkg/bin/mongodump: Cannot write-enable text segment: Permission denied
> 
> Please don't disable PAX and deal with text relocations properly.

Huh. Ok, looking deeper, this seems to be due to cgo... the normal
workaround is to 'go build -buildmode=pie', which, sadly, does not
appear supported on netbsd-amd64. This is bigger than just "report
upstream" :/

/usr/pkg/go119/bin/go build -buildmode=pie -tags "" -o bin/bsondump bsondump/main/bsondump.go
-buildmode=pie not supported on netbsd/amd64

So, without pie, ld.elf_so tries to process text relocations, and fails
due to PaX?

-- 
Paul Ripke
"Great minds discuss ideas, average minds discuss events, small minds
 discuss people."
-- Disputed: Often attributed to Eleanor Roosevelt. 1948.


Home | Main Index | Thread Index | Old Index