From owner-freebsd-questions@FreeBSD.ORG Tue Aug 16 14:49:16 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA213106566C for ; Tue, 16 Aug 2011 14:49:16 +0000 (UTC) (envelope-from aimass@yabarana.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 73DCF8FC0C for ; Tue, 16 Aug 2011 14:49:16 +0000 (UTC) Received: by gyd10 with SMTP id 10so4417602gyd.13 for ; Tue, 16 Aug 2011 07:49:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.147.65 with SMTP id m1mr5943601icv.46.1313506155491; Tue, 16 Aug 2011 07:49:15 -0700 (PDT) Sender: aimass@yabarana.com Received: by 10.231.38.1 with HTTP; Tue, 16 Aug 2011 07:49:15 -0700 (PDT) Date: Tue, 16 Aug 2011 10:49:15 -0400 X-Google-Sender-Auth: E0Egh8t1LT6EfscWMANYsX5h7V4 Message-ID: From: Alejandro Imass To: FreeBSD Questions Content-Type: text/plain; charset=ISO-8859-1 Subject: Getting __errno_location when loading Perl XS module on FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2011 14:49:16 -0000 Hello I'm compiling a proprietary lib on FreeBSD that offers a Perl API via XS. The package comes with an ar archive for Linux 64 but I need to compile it and run it on FreeBSD. FreeBSD make process makes no complaints about the object files in the ar in the make process, and everything makes without an error. The lib compiles fine, but when the dynaloader is loading I get: /libexec/ld-elf.so.1: (undisclosed).so: Undefined symbol "__errno_location" Is this ld-elf complaining that it does not find the symbol in (undisclosed), or is it (undisclosed) not finding the symbol in it's dependencies? I've been trying to learn more about __errno_location but some say it's relates to the pthreads lib, some that it's libm and should be defined in errno.h, but nope, it's not defined in any .h in Linux or FreeBSD! As you can see, the lib build fine and satisfies all dependencies. Shouldn't the undefined symbol pop-up during linking of the shared object (during creation) instead than on dynamic linking? ldd blib/arch/auto/.so blib/arch/auto/Gateway/Gateway.so: libcurl.so.6 => /usr/local/lib/libcurl.so.6 (0x800c00000) libssl.so.6 => /usr/lib/libssl.so.6 (0x800d54000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x800ea7000) libm.so.5 => /lib/libm.so.5 (0x8010b7000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x8011d7000) libc.so.7 => /lib/libc.so.7 (0x800647000) libcrypto.so.6 => /lib/libcrypto.so.6 (0x8012e5000) libz.so.5 => /lib/libz.so.5 (0x801585000) [download] Thanks in advance for any comments.