NetBSD Problem Report #56668

From www@netbsd.org  Tue Jan 25 04:32:05 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 E37211A9239
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 25 Jan 2022 04:32:05 +0000 (UTC)
Message-Id: <20220125043204.C27A21A923A@mollari.NetBSD.org>
Date: Tue, 25 Jan 2022 04:32:04 +0000 (UTC)
From: hiroshi-hakoyama@nagano.ac.jp
Reply-To: hiroshi-hakoyama@nagano.ac.jp
To: gnats-bugs@NetBSD.org
Subject: libuv-1.43.0nb2 fails to compile on Solaris 10
X-Send-Pr-Version: www-1.0

>Number:         56668
>Category:       pkg
>Synopsis:       libuv-1.43.0nb2 fails to compile on Solaris 10
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 25 04:35:00 +0000 2022
>Originator:     Hiroshi Hakoyama
>Release:        pkgsrc current
>Organization:
Institute of Freshwater Biology, Nagano University
>Environment:
SunOS ec21 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Blade-1000
>Description:
libuv-1.43.0nb2 fails to compile on Solaris 10.

the problem is caused by missing -fPIC flag.

# cd /usr/pkgsrc/devel/libuv
# make

...
  CCLD     libuv.la
Text relocation remains                         referenced
    against symbol                  offset      in file
MD5Update                           0x1248      /usr/pkgsrc/devel/libuv/work/libnbcompat/libnbcompat.a(md5c.o)
.rodata (section)                   0xfac       
...
__assert_c99                        0x1350      /usr/pkgsrc/devel/libuv/work/libnbcompat/libnbcompat.a(md5c.o)
__assert_c99                        0x1374      /usr/pkgsrc/devel/libuv/work/libnbcompat/libnbcompat.a(md5c.o)
ld: fatal: relocations remain against allocatable but non-writable sections
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/devel/libuv/work/libuv-1.43.0
*** Error code 1

Stop.
bmake[1]: stopped in /usr/pkgsrc/devel/libuv
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/devel/libuv
>How-To-Repeat:
# cd /usr/pkgsrc/devel/libuv
# make

>Fix:
The build error was gone when I added -fPIC to CFLAGS+= in Makefile.

Please see references (eg.):
https://stackoverflow.com/questions/31605687/ld-fatal-relocations-remain-against-allocatable-but-non-writable-sections-whe

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.