NetBSD Problem Report #55762

From www@netbsd.org  Wed Oct 28 19:41:12 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 094051A9239
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 28 Oct 2020 19:41:12 +0000 (UTC)
Message-Id: <20201028194057.117961A923C@mollari.NetBSD.org>
Date: Wed, 28 Oct 2020 19:40:57 +0000 (UTC)
From: coypu@sdf.org
Reply-To: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Subject: libGL.so built with text relocations, fails to run
X-Send-Pr-Version: www-1.0

>Number:         55762
>Category:       xsrc
>Synopsis:       libGL.so built with text relocations, fails to run
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    xsrc-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 28 19:45:00 +0000 2020
>Closed-Date:    Sun Nov 01 01:04:37 +0000 2020
>Last-Modified:  Sun Nov 01 01:04:37 +0000 2020
>Originator:     coypu
>Release:        NetBSD 9.99.74
>Organization:
>Environment:
netbsd 9.99.74 i386
>Description:
destdir.i386 [1]> env LIBGL_DRIVERS_PATH=./usr/X11R7/lib/modules/dri LIBGL_ALWAYS_SOFTWARE=1 LD_LIBRARY_PATH=./usr/X11R7/lib:./usr/lib ./usr/X11R7/bin/glxgears
./usr/X11R7/lib/libGL.so.3: text relocations
./usr/X11R7/lib/libglapi.so.1: text relocations



If adding

CFLAGS+= -Wl,--warn-shared-textrel

And rebuilding src/external/mit/xorg/lib/libGL:

ld: libGL_pic.a(entry.pico): warning: relocation against `_glapi_get_dispatch' in read-only section `.text'
warning: creating a DT_TEXTREL in a shared object

This likely occurred from disabling GLX_USE_TLS and shuffling asm code around (so now we use entry_x86_tsd.h instead of entry_x86_tls.h)

Note that we DO have:

lib/asm.mk:


X11ASM_CPPFLAGS.i386+=  \
        -DUSE_X86_ASM \
...
        -DGLX_X86_READONLY_TEXT


>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sun, 01 Nov 2020 01:04:37 +0000
State-Changed-Why:
Not a current issue as GLX_USE_TLS was enabled. If we choose this path again it is something to keep in mind.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.