From owner-freebsd-bugs@FreeBSD.ORG Mon Nov 29 19:40:04 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72EBD16A4CE for ; Mon, 29 Nov 2004 19:40:04 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CD1643D60 for ; Mon, 29 Nov 2004 19:40:04 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iATJe4in090998 for ; Mon, 29 Nov 2004 19:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iATJe4WL090993; Mon, 29 Nov 2004 19:40:04 GMT (envelope-from gnats) Resent-Date: Mon, 29 Nov 2004 19:40:04 GMT Resent-Message-Id: <200411291940.iATJe4WL090993@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nehal Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A33916A4CE for ; Mon, 29 Nov 2004 19:38:19 +0000 (GMT) Received: from shaw.ca (S0106000ae6ceb225.vf.shawcable.net [70.68.12.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43AF943D4C for ; Mon, 29 Nov 2004 19:38:19 +0000 (GMT) (envelope-from Nehal@shaw.ca) Received: from Nehal.Home (somebody@localhost [127.0.0.1]) by shaw.ca (8.13.1/8.13.1) with ESMTP id iATJcXbW022816 for ; Mon, 29 Nov 2004 11:38:33 -0800 (PST) (envelope-from Nehal@Nehal.Home) Received: (from Nehal@localhost) by Nehal.Home (8.13.1/8.13.1/Submit) id iATJcX0o022815; Mon, 29 Nov 2004 11:38:33 -0800 (PST) (envelope-from Nehal) Message-Id: <200411291938.iATJcX0o022815@Nehal.Home> Date: Mon, 29 Nov 2004 11:38:33 -0800 (PST) From: Nehal To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: gnu/74531: gcc doesn't link correctly if -pg specified X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Nehal List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2004 19:40:04 -0000 >Number: 74531 >Category: gnu >Synopsis: gcc doesn't link correctly if -pg specified >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Nov 29 19:40:03 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Nehal Mistry >Release: FreeBSD 5.3-RELEASE i386 >Organization: >Environment: System: FreeBSD Nehal.Home 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov 5 04:19:18 UTC 2004 root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: compiling the attached test normally with: gcc prof_test.c `sdl11-config --cflags --libs` works fine. but if you want to add profiling support with: gcc -pg prof_test.c `sdl11-config --cflags --libs` it will give a bunch of linking errors. adding '-lc' will fix the linking errors, but will core dump when run because of the linking order. adding '-lpthread -lc' is the only way to have it link and run without any problems. i believe this is a bug, i don't see how profiling should change the behaviour of linking. >How-To-Repeat: try to compile the attached test with: gcc -pg prof_test.c `sdl11-config --cflags --libs` >Fix: --- prof_test.c begins here --- #include "SDL11/SDL.h" int main() { SDL_Init(SDL_INIT_TIMER); return 0; } --- prof_test.c ends here --- >Release-Note: >Audit-Trail: >Unformatted: