This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/34284] New: Missing dynamic library support for GNAT 4.3.0 on x86-*-Darwin8
- From: "bechir dot zalila at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2007 10:05:31 -0000
- Subject: [Bug ada/34284] New: Missing dynamic library support for GNAT 4.3.0 on x86-*-Darwin8
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi,
* Detailed description:
=======================
The file gcc/trunk/gnattools/configure.ac contains the definition of the
variable TOOLS_TARGET_PAIRS for each supported target. The x86-darwin case is
missing which results in using the default file mlib-tgt-specific.adb when
building GNAT for this platform. This file does not implement dynamic library
support.
The patch given at the end of this report solves the problem.
* How to reproduce the bug:
===========================
I did not succeed to attach files to this bug report, thus I will give
them here as plain text. They are very short:
SPEC (p.ads):
=============
package P is
procedure Dummy;
end P;
BODY (p.adb):
=============
package body P is
-----------
-- Dummy --
-----------
procedure Dummy is
begin
null;
end Dummy;
end P;
PROJECT FILE (not_working_project.gpr):
=======================================
project Not_Working_Project is
for Source_Files use ("p.ads", "p.adb");
for Library_Name use "my_lib";
for Library_Dir use "./libs";
for Object_Dir use "./objects";
for Library_Kind use "relocatable";
end Not_Working_Project;
COMMAND LINE:
=============
gnatmake -p -P not_working_project.gpr
EXPECTED BEHAVIOR:
==================
object directory "/Volumes/Stock/Dev/gnat_bug_report/./objects" created
library directory "/Volumes/Stock/Dev/gnat_bug_report/./libs" created
gcc -c -fPIC -I- -gnatA /Volumes/Stock/Dev/gnat_bug_report/p.adb
building relocatable library for project not_working_project
/usr/local/gnat-430/bin/gcc -dynamiclib -o
/Volumes/Stock/Dev/gnat_bug_report/libs/libmy_lib.dylib
-L/usr/local/gnat-430/lib/gcc/i686-apple-darwin8/4.3.0/adalib/ -fPIC
-L/usr/local/gnat-430/lib/gcc/i686-apple-darwin8/4.3.0/adalib/ -lgnat-4.3
-Wl,-flat_namespace -shared-libgcc
/Volumes/Stock/Dev/gnat_bug_report/objects/p.o
If we do an ls libs, we should get:
libmy_lib.dylib p.ali
ACTUAL BEHAVIOR:
================
object directory "/Volumes/Stock/Dev/gnat_bug_report/./objects" created
library directory "/Volumes/Stock/Dev/gnat_bug_report/./libs" created
not_working_project.gpr:4:25: warning: libraries are not supported on this
platform
gcc -c -I- -gnatA /Volumes/Stock/Dev/gnat_bug_report/p.adb
And there the 'libs' directory is empty
Here is my system configuration:
* the exact version of GCC, as shown by "gcc -v";
Using built-in specs.
Target: i686-apple-darwin8
Configured with: ../gcc_trunk/configure --disable-nls
--prefix=/Volumes/Stock/dev/gcc-4.3_trunk --host=i686-apple-darwin8
--target=i686-apple-darwin8 --build=i686-apple-darwin8 --enable-languages=c,ada
--with-gmp=/opt/local
Thread model: posix
gcc version 4.3.0 20071119 (experimental) (GCC)
* the system type (uname -a);
Darwin xxxxxxxxx.xxxx.xx 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10
18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386
* the options when GCC was configured/built;
../gcc_trunk/configure --disable-nls --prefix=/Volumes/Stock/dev/gcc-4.3_trunk
--host=i686-apple-darwin8 --target=i686-apple-darwin8
--build=i686-apple-darwin8 --enable-languages=c,ada --with-gmp=/opt/local
* Patchfile that solves the problem (produced using svn diff from
gcc/trunk/gcc):
---------------------------------------------------------------
2007-11-29 Bechir Zalila <bechir.zalila@enst.fr>
* gnattools/configure.ac: Added a missing switch case for
*86-*-darwin* when defining the value of TOOLS_TARGET_PAIRS.
* gnattools/configure: regenerated
=============================================================================
Index: gnattools/configure
===================================================================
--- gnattools/configure (revision 130291)
+++ gnattools/configure (working copy)
@@ -1667,7 +1667,7 @@
indepsw.adb<indepsw-mingw.adb"
EXTRA_GNATTOOLS='../../gnatdll$(exeext)'
;;
- powerpc-*-darwin*)
+ powerpc-*-darwin* | *86-*-darwin*)
TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-darwin.adb"
;;
*-*-lynxos)
Index: gnattools/configure.ac
===================================================================
--- gnattools/configure.ac (revision 130291)
+++ gnattools/configure.ac (working copy)
@@ -150,7 +150,7 @@
indepsw.adb<indepsw-mingw.adb"
EXTRA_GNATTOOLS='../../gnatdll$(exeext)'
;;
- powerpc-*-darwin*)
+ powerpc-*-darwin* | *86-*-darwin*)
TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-darwin.adb"
;;
*-*-lynxos)
--
Summary: Missing dynamic library support for GNAT 4.3.0 on x86-*-
Darwin8
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bechir dot zalila at gmail dot com
GCC build triplet: i686-apple-darwin8
GCC host triplet: i686-apple-darwin8
GCC target triplet: i686-apple-darwin8
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34284