From owner-freebsd-ports@FreeBSD.ORG Mon Jun 23 05:19:44 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D33EFA8 for ; Mon, 23 Jun 2014 05:19:44 +0000 (UTC) Received: from mail.mgedv.net (mail.mgedv.net [83.64.34.254]) by mx1.freebsd.org (Postfix) with ESMTP id C65662D58 for ; Mon, 23 Jun 2014 05:19:43 +0000 (UTC) Received: from my.loop (client.my.loop [255.255.255.255]) Message-ID: <53A7B8ED.5070808@mgedv.net> Date: Mon, 23 Jun 2014 07:19:41 +0200 From: "no@spam@mgedv.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: Fwd: ksh93 static linking fails (ksh93, 10.0-STABLE, amd64) References: <53A71364.1060703@mgedv.net> In-Reply-To: <53A71364.1060703@mgedv.net> X-Forwarded-Message-Id: <53A71364.1060703@mgedv.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 05:19:44 -0000 hi, due to no response from -questions, fork'd to ports, too :-) -------- Original Message -------- i need to link ksh statically, but don't get it done. i use ast-ksh-20120801 and INIT-20130524, as well as the 3 patches from the freebsd ksh93 port. CCFLAGS=CFLAGS=-O2 -pipe LDFLAGS=-lm dynamic linking successes with the follwing command: [cwd=/build/arch/freebsd10.amd64/src/cmd/ksh93] cc -O2 -pipe -lm -L. -L/build/arch/freebsd10.amd64/lib \ -o ksh pmain.o libshell.a \ /build/arch/freebsd10.amd64/lib/libdll.a \ /build/arch/freebsd10.amd64/lib/libast.a \ /build/arch/freebsd10.amd64/lib/libast.a \ /build/arch/freebsd10.amd64/lib/libcoshell.a \ /build/arch/freebsd10.amd64/lib/libast.a \ /build/arch/freebsd10.amd64/lib/libast.a \ /build/arch/freebsd10.amd64/lib/libcmd.a \ -lmd -lutil /build/arch/freebsd10.amd64/lib/libast.a \ -lmd -lutil /build/arch/freebsd10.amd64/lib/libast.a \ /build/arch/freebsd10.amd64/lib/libast.a \ /build/arch/freebsd10.amd64/lib/libast.a my "final" static command (after many others): cc -s -v -O2 -pipe -lm -static \ -L. -L./arch/freebsd10.amd64/lib \ -o ./ksh_static \ ./arch/freebsd10.amd64/src/cmd/ksh93/pmain.o \ ./arch/freebsd10.amd64/src/cmd/ksh93/libshell.a \ -lc -lm -lmd -lutil ./arch/freebsd10.amd64/lib/libdll.a \ ./arch/freebsd10.amd64/lib/libcoshell.a \ ./arch/freebsd10.amd64/lib/libcmd.a \ ./arch/freebsd10.amd64/lib/libast.a the errors from the command above are: ./arch/freebsd10.amd64/src/cmd/ksh93/libshell.a(strdata.o):(.rodata+0x7c8): warning: powl has lower than advertised precision ./arch/freebsd10.amd64/src/cmd/ksh93/libshell.a(strdata.o):(.rodata+0x3a8): warning: coshl has lower than advertised precision ./arch/freebsd10.amd64/src/cmd/ksh93/libshell.a(strdata.o):(.rodata+0x3d8): warning: erfcl has lower than advertised precision ./arch/freebsd10.amd64/src/cmd/ksh93/libshell.a(strdata.o):(.rodata+0x3c0): warning: erfl has lower than advertised precision ./arch/freebsd10.amd64/src/cmd/ksh93/libshell.a(strdata.o):(.rodata+0x6f0): warning: lgammal has lower than advertised precision ./arch/freebsd10.amd64/src/cmd/ksh93/libshell.a(strdata.o):(.rodata+0x888): warning: sinhl has lower than advertised precision ./arch/freebsd10.amd64/src/cmd/ksh93/libshell.a(strdata.o):(.rodata+0x8d0): warning: tanhl has lower than advertised precision ./arch/freebsd10.amd64/src/cmd/ksh93/libshell.a(strdata.o):(.rodata+0x8e8): warning: tgammal has lower than advertised precision ./arch/freebsd10.amd64/lib/libast.a(malloc.o): In function `__calloc': /build/src/lib/libast/vmalloc/malloc.c:(.text+0xfe0): multiple definition of `__calloc' /usr/lib/libc.a(jemalloc_jemalloc.o):jemalloc_jemalloc.c:(.text+0x29a0): first defined here ./arch/freebsd10.amd64/lib/libast.a(malloc.o): In function `__free': /build/src/lib/libast/vmalloc/malloc.c:(.text+0x1000): multiple definition of `__free' /usr/lib/libc.a(jemalloc_jemalloc.o):jemalloc_jemalloc.c:(.text+0x54a0): first defined here ./arch/freebsd10.amd64/lib/libast.a(malloc.o): In function `__malloc': /build/src/lib/libast/vmalloc/malloc.c:(.text+0x1010): multiple definition of `__malloc' /usr/lib/libc.a(jemalloc_jemalloc.o):jemalloc_jemalloc.c:(.text+0x210): first defined here ./arch/freebsd10.amd64/lib/libast.a(malloc.o): In function `__realloc': /build/src/lib/libast/vmalloc/malloc.c:(.text+0x1020): multiple definition of `__realloc' /usr/lib/libc.a(jemalloc_jemalloc.o):jemalloc_jemalloc.c:(.text+0x3d00): first defined here cc: error: linker command failed with exit code 1 (use -v to see invocation) i tried re-arranging the -l stuff, changed the .a orders, but still without final success. i managed to statically link version 20120801, but the version is unstable and hangs itself. i know i'm doing smth completely wrong here, but don't get it. and please, i don't wanna discuss static linking at all ;-) any ideas welcome ;-)