Author Archives: te-bachi

Optical Character Recognition (OCR)

OCR Software

tesseract-ocr
enfocus PitStop Pro
Foxit PhantomPDF™ Business 6.2
SmartSoft OCR Software
CVISION PDF Images to Text OCR
CVISION Font Recognition Software
CVISION pdf compressor

Articles

Better PDF OCR. ClearScan is smaller, looks better
Better PDF OCR: ClearScan is smaller, looks better

Forum

Acrobat Tips
How can I identify fonts from an image?
How To Recognize A Font?

VoIP

SNOM 300

FAQ

How can I enable multiple language support for snom300
How can I set the phone back to admin mode or factory defaults respectively
Firmware/Update/TFTP Update

XML Konfiguration

Configuration Files
Configuration Files/XML
Mass Deployment V7 (PDF)

update_policy
firmware_status
firmware_interval
admin_mode
admin_mode_password
http_user
http_pass

Grandstream Networks, Inc.

Grandstream HandyTone 486 ATA

Grandstream HandyTone 702 ATA

Grandstream HT701/HT702/HT704 Analog Telephone Adaptor (PDF)

Authentisierung Authentifizierung Autorisierung

  • Identifizierung
  • Verifizierung
  • Authentisierung
  • Authentifizierung
  • Autorisierung

Bei fast allen informationsverarbeitenden Systemen ist eine Identifizierung und Authentifizierung Vorraussetzung für die Autorisierung des Zugriffs auf Daten und Funktionen. Da alle drei Begriffe im Sprachgebrauch häufig synonym verwendet werden, sollen die Vorgänge und Begrifflichkeiten hier einmal abgegrenzt und erklärt werden:

Szenario: A möchte Zugriff auf eine Ressource, die durch Instanz B geschützt wird. A und B können dabei jeweils Personen oder Informationssysteme sein.
Identifizierung: A informiert B über seine Identität
Authentisierung: A übergibt Informationen, die eine Verifizierung seiner Identität durch B erlauben
Authentifizierung: B üerprüft, ob die vorgegebene Identität durch die Authentisierungsdaten bestätigt werden kann
Autorisierung: B läßt nach erfolgreicher Authentifizierung den Zugriff auf angeforderte Ressource zu.

Socket Programming

General

IPv6 Network Programming
Listen for and accept TCP connections in C
Sockets-based Communication Using IPv6
Linux IPv6 HOWTO (en)
Programming using C-API
Socket programming and the C BSD API
Protocol Independent Programming
Convert an IP address to a human-readable string in C

DNS

Using Google Public DNS (with IPv6)

ipv6.google.com

Beej’s Guide to Network Programming

9.7. gethostbyname(), gethostbyaddr()

Manual Pages

Wikipedia

getaddrinfo

linux.die.net

getaddrinfo(3)

man7.org

GETHOSTBYNAME(3)

Question & Statements

How to support both IPv4 and IPv6 connections
FreeBSD: Interesting facts about AI_ADDRCONFIG
Tell whether a text string is an IPv6 address or IPv4 address using standard C sockets API
How to determine if a string is a valid IPv6 address in C++?

Timeout

Linux: is there a read or recv from socket with timeout?
Socket with recv-timeout: What is wrong with this code?
Does recv(…) operate this way?

RFC

RFC 3493 – Basic Socket Interface Extensions for IPv6, February 2003
RFC 4038 – Application Aspects of IPv6 Transition, March 2005

Unix – Set/Rename Process Title

General

prctl – operations on a process

FreeBSD

setproctitle — set process title

Linux

About ELF Auxiliary Vectors
setproctitle()
linux: change the process’ name
procname

argv

procnamemodule.c
Howto change a UNIX process and child process name by modifying argv[0]
change process name without change argv[0] in Linux
Change process name in Linux
Giving a process a specific name in GNU/Linux?

Cross Debugging with GDB

FreeBSD under Linux

Build

i386fbsd-tdep.c:48:12: error: static declaration of ‘i386fbsd_sc_reg_offset’ follows non-static declaration
In file included from i386fbsd-tdep.c:26:0:
i386-tdep.h:228:12: note: previous declaration of ‘i386fbsd_sc_reg_offset’ was here
make[1]: *** [i386fbsd-tdep.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gdb-6.1.1/gdb'
make: *** [all-gdb] Error 2

# grep -r i386fbsd_sc_reg_offset .
./gdb/i386bsd-nat.c:#define SC_REG_OFFSET i386fbsd_sc_reg_offset
./gdb/i386fbsd-tdep.c:static int i386fbsd_sc_reg_offset[] =
./gdb/i386fbsd-tdep.c:  tdep->sc_reg_offset = i386fbsd_sc_reg_offset;
./gdb/i386fbsd-tdep.c:  tdep->sc_num_regs = ARRAY_SIZE (i386fbsd_sc_reg_offset);
./gdb/i386-tdep.h:extern int i386fbsd_sc_reg_offset[];

Execute

(gdb) file apu/src/dns-amplification-defender/dnsdefend
Reading symbols from apu/src/dns-amplification-defender/dnsdefend...Dwarf Error: Cannot handle DW_FORM_<unknown> in DWARF reader [in module /home/andreas/apu/src/dns-amplification-defender/dnsdefend]
(gdb) target remote 10.41.10.20:2345
Remote debugging using 10.41.10.20:2345
0x000000080060c070 in ?? ()
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
warning: shared library handler failed to enable breakpoint

Receiving GDB error “Dwarf Error: Cannot handle DW_FORM_flag_present in DWARF reader [in module /xxx/yyy/executable]”

GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=x86_64-pc-freebsd10.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
(gdb) file apu/src/dns-amplification-defender/dnsdefend
Reading symbols from /home/andreas/apu/src/dns-amplification-defender/dnsdefend...done.
(gdb) target remote 10.41.10.20:2345
Remote debugging using 10.41.10.20:2345
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x000000080060c070 in ?? ()
(gdb) b dns_header_decode_label
Breakpoint 1 at 0x406bf4: file src/packet/dns_header.c, line 159.
(gdb) r
The "remote" target does not support "run".  Try "help target" or "continue".
(gdb) help target
Connect to a target machine or process.
The first argument is the type or protocol of the target machine.
Remaining arguments are interpreted by the target protocol.  For more
information on the arguments for a particular protocol, type
`help target ' followed by the protocol name.

List of target subcommands:

target bsd-uthreads -- BSD user-level threads
target core -- Use a core file as a target
target exec -- Use an executable file as a target
target extended-remote -- Use a remote computer via a serial line
target record -- Log program while executing and replay execution from log
target record-btrace -- Collect control-flow trace and provide the execution history
target record-core -- Log program while executing and replay execution from log
target record-full -- Log program while executing and replay execution from log
target remote -- Use a remote computer via a serial line
target tfile -- Use a trace file as a target

Type "help target" followed by target subcommand name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.
(gdb) set sysroot /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/
bin/     include/ lib/     usr/     
(gdb) set sysroot /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
(gdb) bt
#0  0x000000080060c070 in ?? ()
#1  0x0000000000000001 in ?? ()
#2  0x00007fffffffdd58 in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) set sysroot /usr/x86_64-freebsd/x86_64-pc-freebsd10.0
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
(gdb) bt
#0  0x000000080060c070 in ?? ()
#1  0x0000000000000001 in ?? ()
#2  0x00007fffffffdd58 in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) c
Continuing.
warning: Could not load shared library symbols for /libexec/ld-elf.so.1.
Do you need "set solib-search-path" or "set sysroot"?

Program received signal SIGBUS, Bus error.
0x0000000800949f8a in ?? () from /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/libc.so.7
(gdb) set sysroot /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
(gdb) c
Continuing.

Program terminated with signal SIGBUS, Bus error.
The program no longer exists.
(gdb) quit
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=x86_64-pc-freebsd10.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
(gdb) ffile apu/src/dns-amplification-defender/dnsdefend
Undefined command: "ffile".  Try "help".
(gdb) file apu/src/dns-amplification-defender/dnsdefend
Reading symbols from /home/andreas/apu/src/dns-amplification-defender/dnsdefend...done.
(gdb) target remote 10.41.10.20:2345
Remote debugging using 10.41.10.20:2345
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x000000080060c070 in ?? ()
(gdb) c
Continuing.
warning: Could not load shared library symbols for 2 libraries, e.g. /lib/libc.so.7.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?

Program received signal SIGBUS, Bus error.
0x0000000800949f8a in ?? ()
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=x86_64-pc-freebsd10.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
(gdb) set sysroot /usr/x86_64-freebsd/x86_64-pc-freebsd10.0
(gdb) file apu/src/dns-amplification-defender/dnsdefend
Reading symbols from /home/andreas/apu/src/dns-amplification-defender/dnsdefend...done.
(gdb) target remote 10.41.10.20:2345
Remote debugging using 10.41.10.20:2345
Reading symbols from /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/libexec/ld-elf.so.1
0x000000080060c070 in ?? () from /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/libexec/ld-elf.so.1
(gdb) b dns_header_decode_label
Breakpoint 1 at 0x406bf4: file src/packet/dns_header.c, line 159.
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000400c21 in _start ()
(gdb) bt
#0  0x0000000000400c21 in _start ()

Cross-Compiler

FreeBSD Toolchain

BSD Toolchain Project
The LLVM Compiler Infrastructure
The LLDB Debugger

build – host – target

Traditional cross-compilation terminology defines three platforms:

  • build – the platform we’re building on
  • host – the platform the compiler will run on
  • target – the platform the compiler we’re building will generate code for

Cross-compiling GHC

arch-vendor-os

Can anyone explain the gcc cross-compiler naming convention?

Building a Cross-Compiler

How to make a cross compiler (gcc) for freebsd under linux. A small tutorial

GNU development tools (binutils)

This directory contains various GNU compilers, assemblers, linkers,
debuggers, etc., plus their support routines, definitions, and documentation.t

$ mkdir /usr/x86_64-freebsd
$ mkdir /usr/x86_64-freebsd/src

$ mv ~/Downloads/binutils-2.24.tar.gz /usr/x86_64-freebsd/src
$ cd /usr/x86_64-freebsd/src
$ tar -xzf binutils-2.24.tar.gz
$ cd binutils-2.24
$ ./configure --enable-libssp --enable-gold --enable-ld \
--target=x86_64-pc-freebsd10.0 --prefix=/usr/x86_64-freebsd
$ make -j 4
$ make install

GNU MP (gmp)

GNU MP is a library for arbitrary precision arithmetic, operating on signed
integers, rational numbers, and floating point numbers.

$ mv ~/Downloads/gmp-5.1.3.tar.gz /usr/x86_64-freebsd/src
$ cd /usr/x86_64-freebsd/src
$ tar -xzf gmp-5.1.3.tar.gz
$ cd gmp-5.1.3
$ ./configure --prefix=/usr/x86_64-freebsd --enable-shared \
--enable-static --enable-mpbsd --enable-fft --enable-cxx \
--host=x86_64-pc-freebsd10.0
configure: summary of build options:

  Version:           GNU MP 5.1.3
  Host type:         x86_64-pc-freebsd10.0
  ABI:               64
  Install prefix:    /usr/x86_64-freebsd
  Compiler:          gcc -std=gnu99
  Static libraries:  yes
  Shared libraries:  yes
$ make -j 4
$ make install
+-------------------------------------------------------------+
| CAUTION:                                                    |
|                                                             |
| If you have not already run "make check", then we strongly  |
| recommend you do so.                                        |
|                                                             |
| GMP has been carefully tested by its authors, but compilers |
| are all too often released with serious bugs.  GMP tends to |
| explore interesting corners in compilers and has hit bugs   |
| on quite a few occasions.                                   |
|                                                             |
+-------------------------------------------------------------+
$ make check

GNU MPFR (mpfr)

The MPFR library is a C library for multiple-precision floating-point computations with correct rounding.

$ mv ~/Downloads/mpfr-3.1.2.tar.gz /usr/x86_64-freebsd/src
$ cd /usr/x86_64-freebsd/src
$ tar -xzf mpfr-3.1.2.tar.gz
$ cd mpfr-3.1.2
$ ./configure --prefix=/usr/x86_64-freebsd --with-gnu-ld \
--with-gmp=/usr/x86_64-freebsd --enable-static \
--enable-shared --host=x86_64-pc-freebsd10.0
$ make -j 4
$ make install

GNU MPC (mpc)

GNU MPC is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result.

$ mv ~/Downloads/mpc-1.0.2.tar.gz /usr/x86_64-freebsd/src
$ cd /usr/x86_64-freebsd/src
$ tar -xzf mpc-1.0.2.tar.gz
$ cd mpc-1.0.2
$  ./configure --prefix=/usr/x86_64-freebsd --with-gnu-ld \
--with-gmp=/usr/x86_64-freebsd --with-mpfr=/usr/x86_64-freebsd \
--enable-static --enable-shared --host=x86_64-pc-freebsd10.0
$ make -j 4
$ make install

GNU libgomp

The GOMP project has developed an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection and is further improving it. As part of the GNU Project, GOMP simplifies parallel programming for all GNU system variants. This effort operates in an open environment to attract developers and ensure applicability across multiple architectures and applications.

Not used!

GCC

$ mv ~/Downloads/gcc-4.8.3.tar.gz /usr/x86_64-freebsd/src
$ cd /usr/x86_64-freebsd/src
$ tar -xzf gcc-4.8.3.tar.gz
$ cd gcc-4.8.3
$ mkdir obj
$ cd obj
$ ../configure --without-headers --with-gnu-as --with-gnu-ld \
--enable-languages=c,c++ --disable-nls --enable-libssp \
--enable-gold --enable-ld --target=x86_64-pc-freebsd10.0 \
--prefix=/usr/x86_64-freebsd \
--with-gmp=/usr/x86_64-freebsd \
--with-mpc=/usr/x86_64-freebsd \
--with-mpfr=/usr/x86_64-freebsd \
--disable-libgomp
$ LD_LIBRARY_PATH=/usr/x86_64-freebsd/lib make -j 4

../configure --without-headers --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-nls --enable-libssp --enable-gold --enable-ld --target=x86_64-pc-freebsd10.0 --prefix=/usr/x86_64-freebsd --with-gmp=/usr/x86_64-freebsd --with-mpc=/usr/x86_64-freebsd --with-mpfr=/usr/x86_64-freebsd --disable-libgomp --with-build-sysroot=/usr/x86_64-freebsd

FAQ

$ mv ~/Downloads/gcc-4.8.3.tar.gz /usr/x86_64-freebsd/src
$ cd /usr/x86_64-freebsd/src
$ tar -xzf gcc-4.8.3.tar.gz
$ cd gcc-4.8.3
$ mkdir obj
$ cd obj
$ ../configure [...]
$ LD_LIBRARY_PATH=/usr/x86_64-freebsd/lib make -j 4
[...]
/usr/x86_64-freebsd/src/gcc-4.8.3/obj/./gcc/xgcc -B/usr/x86_64-freebsd/src/gcc-4.8.3/obj/./gcc/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include    -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o cpuinfo_s.o sfp-exceptions_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o fixtfti_s.o fixunstfti_s.o floattitf_s.o floatuntitf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: cannot find /lib/libc.so.7
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: cannot find /usr/lib/libc_nonshared.a
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: cannot find /usr/lib/libssp_nonshared.a
collect2: error: ld returned 1 exit status
make[2]: *** [libgcc_s.so] Error 1
make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/obj/x86_64-pc-freebsd10.0/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/obj'
make: *** [all] Error 2
.../bin/ld: cannot find /lib/libc.so.7
.../bin/ld: cannot find /usr/lib/libc_nonshared.a
.../bin/ld: cannot find /usr/lib/libssp_nonshared.a
$ uname -a
FreeBSD gateway 10.0-RELEASE FreeBSD 10.0-RELEASE #1: Sun Apr 20 15:45:27 CEST 2014     bachi@gateway:/usr/obj/usr/src/sys/INES  amd64

$ find /lib -name 'libc.so*'
/lib/libc.so.7

$ find /usr/lib -name 'libc.so*'
/usr/lib/libc.so

$ find /usr/lib -name 'libc_nonshared*'
/usr/lib/libc_nonshared.a

$ find /usr/lib -name 'libssp_nonshared*'
/usr/lib/libssp_nonshared.a
$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu quantal (development branch)
Release:        12.10
Codename:       quantal

$ uname -a
Linux andreas-OptiPlex-9010 3.5.0-6-generic #6-Ubuntu SMP Mon Jul 23 19:52:14 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

$ find /lib -name 'libc.so*'
/lib/x86_64-linux-gnu/libc.so.6
/lib/i386-linux-gnu/libc.so.6

$ find /usr/lib -name 'libc.so*'
/usr/lib/x86_64-linux-gnu/libc.so

$ find /usr/lib -name 'libc_nonshared*'
/usr/lib/x86_64-linux-gnu/libc_nonshared.a

$ find /usr/lib -name 'libssp_nonshared*'
/usr/lib/gcc/x86_64-linux-gnu/4.7/libssp_nonshared.a
/usr/lib/gcc/arm-linux-gnueabi/4.7/libssp_nonshared.a
$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:        14.04
Codename:       trusty

$ uname -a
Linux ines-OptiPlex-745 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:01 UTC 2014 i686 i686 i686 GNU/Linux

$ find /lib -name 'libc.so*'
/lib/i386-linux-gnu/libc.so.6

$ find /usr/lib -name 'libc.so*'
/usr/lib/i386-linux-gnu/libc.so

$ find /usr/lib -name 'libc_nonshared*'
/usr/lib/i386-linux-gnu/libc_nonshared.a

$ find /usr/lib -name 'libssp_nonshared*'
/usr/lib/gcc/i686-linux-gnu/4.7/libssp_nonshared.a
/usr/lib/gcc/i686-linux-gnu/4.8/libssp_nonshared.a

–disable-multilib

The same as above

Make without LD_LIBRARY_PATH

make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.7.4/objdir/gcc'
Checking multilib configuration for libgcc...
mkdir -p -- x86_64-pc-freebsd10.0/libgcc
Configuring in x86_64-pc-freebsd10.0/libgcc
configure: creating cache ./config.cache
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-pc-freebsd10.0
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for x86_64-pc-freebsd10.0-ar... /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ar
checking for x86_64-pc-freebsd10.0-lipo... x86_64-pc-freebsd10.0-lipo
checking for x86_64-pc-freebsd10.0-nm... /usr/x86_64-freebsd/src/gcc-4.7.4/objdir/./gcc/nm
checking for x86_64-pc-freebsd10.0-ranlib... /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ranlib
checking for x86_64-pc-freebsd10.0-strip... /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/strip
checking whether ln -s works... yes
checking for x86_64-pc-freebsd10.0-gcc... /usr/x86_64-freebsd/src/gcc-4.7.4/objdir/./gcc/xgcc -B/usr/x86_64-freebsd/src/gcc-4.7.4/objdir/./gcc/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include   
checking for suffix of object files... configure: error: in `/usr/x86_64-freebsd/src/gcc-4.7.4/objdir/x86_64-pc-freebsd10.0/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.7.4/objdir'
make: *** [all] Error 2
...

Configure with –with-build-sysroot

# ../configure --without-headers --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-nls --enable-libssp --enable-gold --enable-ld --target=x86_64-pc-freebsd10.0 --prefix=/usr/x86_64-freebsd --with-gmp=/usr/x86_64-freebsd --with-mpc=/usr/x86_64-freebsd --with-mpfr=/usr/x86_64-freebsd --disable-libgomp --disable-multilib --with-build-sysroot=/usr/x86_64-freebsd

# LD_LIBRARY_PATH=/usr/x86_64-freebsd/lib make -j 4
[...]
/usr/x86_64-freebsd/src/gcc-4.7.4/objdir/./gcc/xgcc -B/usr/x86_64-freebsd/src/gcc-4.7.4/objdir/./gcc/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include --sysroot=/usr/x86_64-freebsd   -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o fixtfti_s.o fixunstfti_s.o floattitf_s.o floatuntitf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status
make[2]: *** [libgcc_s.so] Error 1
make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.7.4/objdir/x86_64-pc-freebsd10.0/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.7.4/objdir'
make: *** [all] Error 2

========================================================================

Alles mit sysroot

$ ./configure --enable-libssp --enable-gold --enable-ld --target=x86_64-pc-freebsd10.0 --prefix=/usr/x86_64-freebsd --with-build-sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0
$ ../configure \
--with-gnu-as \
--with-gnu-ld \
--enable-languages=c,c++ \
--disable-nls \
--enable-libssp \
--enable-gold \
--enable-ld \
--target=x86_64-pc-freebsd10.0 \
--prefix=/usr/x86_64-freebsd \
--with-gmp=/usr/x86_64-freebsd \
--with-mpc=/usr/x86_64-freebsd \
--with-mpfr=/usr/x86_64-freebsd \
--disable-libgomp \
--disable-multilib \
--with-build-sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0
$ LD_LIBRARY_PATH=/usr/x86_64-freebsd/lib make
[...]

make[2]: Entering directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
DEFINES='' HEADERS='' \
		../../../libgcc/mkheader.sh > tmp-libgcc_tm.h
/bin/bash ../../../libgcc/../move-if-change tmp-libgcc_tm.h libgcc_tm.h
echo timestamp > libgcc_tm.stamp
/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/xgcc -B/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include --sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0   -g -O2 -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fpic -pthread -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include  -DHAVE_CC_TLS  -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from ../../../libgcc/../gcc/tsystem.h:44:0,
                 from ../../../libgcc/libgcc2.c:27:
/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/gcc/include/stddef.h:56:24: fatal error: sys/_types.h: No such file or directory
 #include <sys/_types.h>
                        ^
compilation terminated.
make[2]: *** [_muldi3.o] Error 1
make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir'
make: *** [all] Error 2

# find /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/include -name _types.h
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/include/sys/_types.h
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/include/machine/_types.h
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/include/x86/_types.h

==========================

/bin/bash ../libtool --tag CXX   --mode=link /usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/xgcc -shared-libgcc -B/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc -nostdinc++ -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src/.libs -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include --sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0   -Wl,-O1 -Wl,-z,relro -Wl,--gc-sections  -fPIC -DPIC  -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi  -fdiagnostics-show-location=once   -ffunction-sections -fdata-sections  -frandom-seed=libstdc++.la  -o libstdc++.la -version-info 6:19:0 -Wl,--version-script=libstdc++-symbols.ver -lm -rpath /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib compatibility.lo compatibility-debug_list.lo compatibility-debug_list-2.lo  compatibility-c++0x.lo compatibility-atomic-c++0x.lo compatibility-thread-c++0x.lo compatibility-chrono.lo  ../libsupc++/libsupc++convenience.la ../src/c++98/libc++98convenience.la ../src/c++11/libc++11convenience.la 
libtool: link:  /usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/xgcc -shared-libgcc -B/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc -nostdinc++ -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src/.libs -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include --sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0   -shared -nostdlib /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib/crti.o /usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/crtbeginS.o  .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o  -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a -Wl,--no-whole-archive  -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src/.libs -lm -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc -L/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin -L/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib -L/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib -lc -lgcc_s /usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/crtendS.o /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib/crtn.o  -Wl,-O1 -Wl,-z -Wl,relro -Wl,--gc-sections -Wl,--version-script=libstdc++-symbols.ver   -Wl,-soname -Wl,libstdc++.so.6 -o .libs/libstdc++.so.6
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib/libm.a(e_sinh.o): relocation R_X86_64_32S against `.rodata.cst16' can not be used when making a shared object; recompile with -fPIC
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib/libm.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[5]: *** [libstdc++.la] Error 1
make[5]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3'
make[1]: *** [all-target-libstdc++-v3] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir'
make: *** [all] Error 2

how to recompile with -fPIC
HOWTO fix -fPIC errors

===================================================

../configure --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-nls --enable-libssp --enable-gold --enable-ld --target=x86_64-pc-freebsd10.0 --prefix=/usr/x86_64-freebsd --with-gmp=/usr/x86_64-freebsd --with-mpc=/usr/x86_64-freebsd --with-mpfr=/usr/x86_64-freebsd --disable-libgomp --enable-shared --with-sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0
/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/xgcc -B/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include    -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o cpuinfo_s.o sfp-exceptions_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o fixtfti_s.o fixunstfti_s.o floattitf_s.o floatuntitf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: cannot find crti.o: No such file or directory
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: cannot find -lc
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [libgcc_s.so] Error 1
make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir'
make: *** [all] Error 2

========================================

libtool: compile:  /usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/xgcc -shared-libgcc -B/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc -nostdinc++ -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src/.libs -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include --sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0 -I/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/include/x86_64-pc-freebsd10.0 -I/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/include -I/usr/x86_64-freebsd/src/gcc-4.8.3/libstdc++-v3/libsupc++ -fPIC -DPIC -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=compatibility-thread-c++0x.lo -g -O2 -std=gnu++11 -c ../../../../libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc -o compatibility-thread-c++0x.o >/dev/null 2>&1
/bin/bash ../libtool --tag CXX   --mode=link /usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/xgcc -shared-libgcc -B/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc -nostdinc++ -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src/.libs -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include --sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0   -Wl,-O1 -Wl,-z,relro -Wl,--gc-sections  -fPIC -DPIC  -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi  -fdiagnostics-show-location=once   -ffunction-sections -fdata-sections  -frandom-seed=libstdc++.la  -o libstdc++.la -version-info 6:19:0 -Wl,--version-script=libstdc++-symbols.ver -lm -rpath /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib compatibility.lo compatibility-debug_list.lo compatibility-debug_list-2.lo  compatibility-c++0x.lo compatibility-atomic-c++0x.lo compatibility-thread-c++0x.lo compatibility-chrono.lo  ../libsupc++/libsupc++convenience.la ../src/c++98/libc++98convenience.la ../src/c++11/libc++11convenience.la 
libtool: link:  /usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/xgcc -shared-libgcc -B/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc -nostdinc++ -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src/.libs -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include --sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0   -shared -nostdlib /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib/crti.o /usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/crtbeginS.o  .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o  -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a -Wl,--no-whole-archive  -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src/.libs -lm -L/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc -L/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin -L/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib -L/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib -lc -lgcc_s /usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/crtendS.o /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib/crtn.o  -Wl,-O1 -Wl,-z -Wl,relro -Wl,--gc-sections -Wl,--version-script=libstdc++-symbols.ver   -Wl,-soname -Wl,libstdc++.so.6 -o .libs/libstdc++.so.6
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib/libm.a(e_sinh.o): relocation R_X86_64_32S against `.rodata.cst16' can not be used when making a shared object; recompile with -fPIC
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib/libm.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[5]: *** [libstdc++.la] Error 1
make[5]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libstdc++-v3'
make[1]: *** [all-target-libstdc++-v3] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir'
make: *** [all] Error 2

============================================

../configure --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-nls --enable-libssp --enable-gold --enable-ld --target=x86_64-pc-freebsd10.0 --prefix=/usr/x86_64-freebsd --with-gmp=/usr/x86_64-freebsd --with-mpc=/usr/x86_64-freebsd --with-mpfr=/usr/x86_64-freebsd --disable-libgomp
/bin/bash ../../../libgcc/../mkinstalldirs .
/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/xgcc -B/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/./gcc/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include    -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o cpuinfo_s.o sfp-exceptions_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o fixtfti_s.o fixunstfti_s.o floattitf_s.o floatuntitf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [libgcc_s.so] Error 1
make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir/x86_64-pc-freebsd10.0/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.8.3/objdir'
make: *** [all] Error 2

==================

../configure --with-gnu-as --with-gnu-ld --enable-languages=c --disable-nls --enable-libssp --enable-gold --enable-ld --target=x86_64-pc-freebsd10.0 --prefix=/usr/x86_64-freebsd --with-gmp=/usr/x86_64-freebsd --with-mpc=/usr/x86_64-freebsd --with-mpfr=/usr/x86_64-freebsd --disable-libgomp --enable-shared --with-build-sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0
libtool: link: /usr/x86_64-freebsd/src/gcc-4.7.4/objdir/./gcc/xgcc -B/usr/x86_64-freebsd/src/gcc-4.7.4/objdir/./gcc/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/sys-include --sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10.0   -shared  math/.libs/acoshq.o math/.libs/fmodq.o math/.libs/acosq.o math/.libs/frexpq.o math/.libs/rem_pio2q.o math/.libs/asinhq.o math/.libs/hypotq.o math/.libs/remainderq.o math/.libs/asinq.o math/.libs/rintq.o math/.libs/atan2q.o math/.libs/isinfq.o math/.libs/roundq.o math/.libs/atanhq.o math/.libs/isnanq.o math/.libs/scalblnq.o math/.libs/atanq.o math/.libs/j0q.o math/.libs/scalbnq.o math/.libs/cbrtq.o math/.libs/j1q.o math/.libs/signbitq.o math/.libs/ceilq.o math/.libs/jnq.o math/.libs/sincos_table.o math/.libs/complex.o math/.libs/ldexpq.o math/.libs/sincosq.o math/.libs/copysignq.o math/.libs/lgammaq.o math/.libs/sincosq_kernel.o math/.libs/coshq.o math/.libs/llroundq.o math/.libs/sinhq.o math/.libs/cosq.o math/.libs/log10q.o math/.libs/sinq.o math/.libs/cosq_kernel.o math/.libs/log1pq.o math/.libs/sinq_kernel.o math/.libs/erfq.o math/.libs/logq.o math/.libs/sqrtq.o math/.libs/expm1q.o math/.libs/lroundq.o math/.libs/tanhq.o math/.libs/expq.o math/.libs/modfq.o math/.libs/tanq.o math/.libs/fabsq.o math/.libs/nanq.o math/.libs/tgammaq.o math/.libs/finiteq.o math/.libs/nextafterq.o math/.libs/truncq.o math/.libs/floorq.o math/.libs/powq.o math/.libs/fmaq.o math/.libs/cacoshq.o math/.libs/cacosq.o math/.libs/casinhq.o math/.libs/casinq.o math/.libs/catanhq.o math/.libs/catanq.o math/.libs/cimagq.o math/.libs/conjq.o math/.libs/cprojq.o math/.libs/crealq.o math/.libs/fdimq.o math/.libs/fmaxq.o math/.libs/fminq.o math/.libs/ilogbq.o math/.libs/llrintq.o math/.libs/log2q.o math/.libs/lrintq.o math/.libs/nearbyintq.o math/.libs/remquoq.o printf/.libs/addmul_1.o printf/.libs/add_n.o printf/.libs/cmp.o printf/.libs/divrem.o printf/.libs/flt1282mpn.o printf/.libs/fpioconst.o printf/.libs/lshift.o printf/.libs/mul_1.o printf/.libs/mul_n.o printf/.libs/mul.o printf/.libs/printf_fphex.o printf/.libs/printf_fp.o printf/.libs/quadmath-printf.o printf/.libs/rshift.o printf/.libs/submul_1.o printf/.libs/sub_n.o strtod/.libs/strtoflt128.o strtod/.libs/mpn2flt128.o strtod/.libs/tens_in_limb.o   -lm  -Wl,--version-script=../../../libquadmath/quadmath.map   -Wl,-soname -Wl,libquadmath.so.0 -o .libs/libquadmath.so.0
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: /usr/x86_64-freebsd/x86_64-pc-freebsd10.0/usr/lib/libm.a(fenv.o): relocation R_X86_64_PC32 against undefined symbol `__stack_chk_guard@@FBSD_1.0' can not be used when making a shared object; recompile with -fPIC
/usr/x86_64-freebsd/x86_64-pc-freebsd10.0/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [libquadmath.la] Error 1
make[3]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.7.4/objdir/x86_64-pc-freebsd10.0/libquadmath'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.7.4/objdir/x86_64-pc-freebsd10.0/libquadmath'
make[1]: *** [all-target-libquadmath] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.7.4/objdir'
make: *** [all] Error 2

================================

binutils

 ./configure \
--enable-libssp \
--enable-gold \
--enable-ld \
--target=x86_64-pc-freebsd10 \
--prefix=/usr/x86_64-freebsd \
--with-sysroot=/usr/x86_64-freebsd/x86_64-pc-freebsd10 \
--enable-static \
--enable-shared
/bin/sh ./libtool --tag=CC   --mode=link gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2  -release `cat libtool-soversion`  -static-libstdc++ -static-libgcc  -o libbfd.la -rpath /usr/x86_64-freebsd/i686-pc-linux-gnu/x86_64-pc-freebsd10/lib archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo `cat ofiles` -L/usr/x86_64-freebsd/src/binutils-2.24/bfd/../libiberty/pic -liberty -Wl,-lc,--as-needed,-lm,--no-as-needed  -lz 
libtool: link: gcc -shared  .libs/archures.o .libs/targets.o .libs/dwarf2.o   -L/usr/x86_64-freebsd/src/binutils-2.24/bfd/../libiberty/pic -liberty -lz  -Wl,-lc -Wl,--as-needed -Wl,-lm -Wl,--no-as-needed   -Wl,-soname -Wl,libbfd-2.24.so -o .libs/libbfd-2.24.so
/usr/bin/ld: cannot find -liberty
collect2: error: ld returned 1 exit status
make[4]: *** [libbfd.la] Error 1
make[4]: Leaving directory `/usr/x86_64-freebsd/src/binutils-2.24/bfd'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/x86_64-freebsd/src/binutils-2.24/bfd'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/x86_64-freebsd/src/binutils-2.24/bfd'
make[1]: *** [all-bfd] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/binutils-2.24'
make: *** [all] Error 2
$ pkg search libiberty
gnulibiberty-2.19.1_2

$ pkg install gnulibiberty-2.19.1_2
The following 1 packages will be affected (of 0 checked):
New packages to be INSTALLED:
	gnulibiberty: 2.19.1_2
The process will require 449 KB more space
111 KB to be downloaded
Proceed with this action [y/N]: y
Fetching gnulibiberty-2.19.1_2.txz: 100% of 111 KB
Checking integrity... done (0 conflicting)
[1/1] Installing gnulibiberty-2.19.1_2: 100%

$ find /usr/local -name 'libiberty*'
/usr/local/include/libiberty
/usr/local/include/libiberty/libiberty.h
/usr/local/lib/libiberty.a
# apt-cache search libiberty
libiberty-dev - library of utility functions used by GNU programs

$ sudo apt-get install libiberty-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libiberty-dev
0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded.
Need to get 135 kB of archives.
After this operation, 542 kB of additional disk space will be used.
Get:1 http://mirror.switch.ch/ftp/mirror/ubuntu/ trusty/main libiberty-dev i386 20131116-1 [135 kB]
Fetched 135 kB in 0s (731 kB/s)   
Selecting previously unselected package libiberty-dev:i386.
(Reading database ... 324870 files and directories currently installed.)
Preparing to unpack .../libiberty-dev_20131116-1_i386.deb ...
Unpacking libiberty-dev:i386 (20131116-1) ...
Setting up libiberty-dev:i386 (20131116-1) ...
/usr/x86_64-freebsd/src/gcc-4.9.1/objdir/./gcc/xgcc
-B/usr/x86_64-freebsd/src/gcc-4.9.1/objdir/./gcc/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10/sys-include -O2  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -DNATIVE_CROSS -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o cpuinfo_s.o sfp-exceptions_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o fixtfti_s.o fixunstfti_s.o floattitf_s.o floatuntitf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/usr/x86_64-freebsd/x86_64-pc-freebsd10/bin/ld: /usr/x86_64-freebsd/x86_64-pc-freebsd10/lib/libc.a(jemalloc_jemalloc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/x86_64-freebsd/x86_64-pc-freebsd10/lib/libc.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status


lrwxrwxrwx 1 root root      17 Aug 31 14:41 libc.a -> ../usr/lib/libc.a
-r--r--r-- 1 root root 1567216 Jan 16  2014 libc.so.7


/usr/x86_64-freebsd/src/gcc-4.9.1/objdir/./gcc/xgcc -B/usr/x86_64-freebsd/src/gcc-4.9.1/objdir/./gcc/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10/bin/ -B/usr/x86_64-freebsd/x86_64-pc-freebsd10/lib/ -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10/include -isystem /usr/x86_64-freebsd/x86_64-pc-freebsd10/sys-include    -O2  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE -DNATIVE_CROSS  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -pthread -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -B./ _muldi3_s.o _negdi2_s.o _lshrdi3_s.o _ashldi3_s.o _ashrdi3_s.o _cmpdi2_s.o _ucmpdi2_s.o _clear_cache_s.o _trampoline_s.o __main_s.o _absvsi2_s.o _absvdi2_s.o _addvsi3_s.o _addvdi3_s.o _subvsi3_s.o _subvdi3_s.o _mulvsi3_s.o _mulvdi3_s.o _negvsi2_s.o _negvdi2_s.o _ctors_s.o _ffssi2_s.o _ffsdi2_s.o _clz_s.o _clzsi2_s.o _clzdi2_s.o _ctzsi2_s.o _ctzdi2_s.o _popcount_tab_s.o _popcountsi2_s.o _popcountdi2_s.o _paritysi2_s.o _paritydi2_s.o _powisf2_s.o _powidf2_s.o _powixf2_s.o _powitf2_s.o _mulsc3_s.o _muldc3_s.o _mulxc3_s.o _multc3_s.o _divsc3_s.o _divdc3_s.o _divxc3_s.o _divtc3_s.o _bswapsi2_s.o _bswapdi2_s.o _clrsbsi2_s.o _clrsbdi2_s.o _fixunssfsi_s.o _fixunsdfsi_s.o _fixunsxfsi_s.o _fixsfdi_s.o _fixdfdi_s.o _fixxfdi_s.o _fixunssfdi_s.o _fixunsdfdi_s.o _fixunsxfdi_s.o _floatdisf_s.o _floatdidf_s.o _floatdixf_s.o _floatundisf_s.o _floatundidf_s.o _floatundixf_s.o _divdi3_s.o _moddi3_s.o _udivdi3_s.o _umoddi3_s.o _udiv_w_sdiv_s.o _udivmoddi4_s.o cpuinfo_s.o sfp-exceptions_s.o addtf3_s.o divtf3_s.o eqtf2_s.o getf2_s.o letf2_s.o multf3_s.o negtf2_s.o subtf3_s.o unordtf2_s.o fixtfsi_s.o fixunstfsi_s.o floatsitf_s.o floatunsitf_s.o fixtfdi_s.o fixunstfdi_s.o floatditf_s.o floatunditf_s.o fixtfti_s.o fixunstfti_s.o floattitf_s.o floatuntitf_s.o extendsftf2_s.o extenddftf2_s.o extendxftf2_s.o trunctfsf2_s.o trunctfdf2_s.o trunctfxf2_s.o enable-execute-stack_s.o unwind-dw2_s.o unwind-dw2-fde-dip_s.o unwind-sjlj_s.o unwind-c_s.o emutls_s.o libgcc.a -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/usr/x86_64-freebsd/x86_64-pc-freebsd10/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make[2]: *** [libgcc_s.so] Error 1
make[2]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.9.1/objdir/x86_64-pc-freebsd10/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/usr/x86_64-freebsd/src/gcc-4.9.1/objdir'
make: *** [all] Error 2

packETH

checking for DEPS... no
configure: error: Package requirements (gtk+-2.0 >= 2.4 glib-2.0 >= 2.4 gthread-2.0 >= 2.4) were not met:

No package 'gtk+-2.0' found
No package 'glib-2.0' found
No package 'gthread-2.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables DEPS_CFLAGS
and DEPS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
$ sudo apt-get install libgtk2.0-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  gir1.2-gtk-2.0 libatk1.0-dev libcairo2-dev libexpat1-dev libfontconfig1-dev
  libfreetype6-dev libgdk-pixbuf2.0-dev libglib2.0-dev libharfbuzz-dev
  libharfbuzz-gobject0 libice-dev libpango1.0-dev libpcre3-dev libpcrecpp0
  libpixman-1-dev libpng12-dev libpthread-stubs0-dev libsm-dev libx11-dev
  libx11-doc libxau-dev libxcb-render0-dev libxcb-shm0-dev libxcb1-dev
  libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev
  libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxml2-utils
  libxrandr-dev libxrender-dev x11proto-composite-dev x11proto-core-dev
  x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev
  x11proto-randr-dev x11proto-render-dev x11proto-xext-dev
  x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev zlib1g-dev
gcc  -g -O2   -o packETH src/main.o src/support.o src/interface.o src/callbacks.o src/function.o src/function_send.o src/loadpacket.o src/savepacket.o  -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lfreetype -lgthread-2.0 -lglib-2.0  
/usr/bin/ld: src/callbacks.o: undefined reference to symbol 'lroundf@@GLIBC_2.1'
//lib/i386-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [packETH] Error 1
make[1]: Leaving directory `/home/ines/src/packETH-1.7.3'
make: *** [all] Error 2