From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2920 invoked by alias); 21 Jan 2015 05:40:01 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 2899 invoked by uid 89); 21 Jan 2015 05:40:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f194.google.com Received: from mail-yk0-f194.google.com (HELO mail-yk0-f194.google.com) (209.85.160.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 21 Jan 2015 05:39:58 +0000 Received: by mail-yk0-f194.google.com with SMTP id 131so373572ykp.1 for ; Tue, 20 Jan 2015 21:39:56 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.236.32.203 with SMTP id o51mr22594690yha.88.1421818796040; Tue, 20 Jan 2015 21:39:56 -0800 (PST) Received: by 10.170.214.86 with HTTP; Tue, 20 Jan 2015 21:39:56 -0800 (PST) Date: Wed, 21 Jan 2015 05:40:00 -0000 Message-ID: Subject: How to compile a static gdb-server? From: fei ding To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00039.txt.bz2 Hey guys: I need to compile a static gdb-server, which LDFLAGS=-static in makefile, but it fails like this: gcc -shared -fPIC -Wl,--no-undefined -g -O2 -I. -I. -I./../common -I./../regformats -I./.. -I./../../include -I./../gnulib/import -Ibuild-gnulib-gdbserver/import -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Wempty-body -DGDBSERVER \ -static -Wl,--dynamic-list=./proc-service.list -o libinproctrace.so ax-ipa.o tracepoint-ipa.o format-ipa.o utils-ipa.o regcache-ipa.o remote-utils-ipa.o common-utils-ipa.o tdesc-ipa.o print-utils-ipa.o rsp-low-ipa.o amd64-linux-ipa.o linux-amd64-ipa.o -ldl -pthread /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/crtbeginT.o: relocation R_X86_64_32 against `__DTOR_END__' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.6/crtbeginT.o: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [libinproctrace.so] Error 1 How can I make it? Thanks a lot.