[Bug ada/38325] New: Long_Long_Float'Image returns a wrong value in some cases

2008-11-30 Thread bechir dot zalila at gmail dot com
The test case below shows a bug in the Long_Long_Float'Image function on
FreeBSD 7:

File test_float.adb;


with Ada.Text_IO;  use Ada.Text_IO;

procedure Test_Float is
   L  : Long_Long_Float := 1.000;
   LL : Long_Long_Float := 10.000;
begin
   Put_Line (Long_Long_Float'Image (L/LL));
end Test_Float;

Expected execution result:
=

10:25 ~/dev% ./test_float 
 1.0E-01

Actual behavior with GNAT-GCC 4.3.2:


10:26 ~/dev% ./test_float   
 1.6E-01

(Note the trailing "6" after the zero's)

GNAT version:
=

10:20 ~/dev% gnatls -v

GNATLS 4.3.2
Copyright (C) 1997-2007, Free Software Foundation, Inc.

Source Search Path:
   
   /opt/packages/gnat-4.3.2/lib/gcc/i686-portbld-freebsd7/4.3.2/adainclude/


Object Search Path:
   
   /opt/packages/gnat-4.3.2/lib/gcc/i686-portbld-freebsd7/4.3.2/adalib/


Project Search Path:
   
   /opt/packages/gnat-4.3.2/lib/gnat/

GCC version:


10:20 ~/dev% gcc -v
Using built-in specs.
Target: i686-portbld-freebsd7
Configured with: ../gcc-4.3.2/configure --prefix=/[snip]/gcc_4.3.2_install
--enable-languages=c,c++,ada --with-gmp=/[snip]/gmp_inst
--with-mpfr=/[snip]/mpfr_inst --disable-nls --host=i686-portbld-freebsd7
--target=i686-portbld-freebsd7 --build=i686-portbld-freebsd7
--enable-checking=release --enable-threads=posix
Thread model: posix
gcc version 4.3.2 (GCC)


-- 
   Summary: Long_Long_Float'Image returns a wrong value in some
cases
   Product: gcc
   Version: 4.3.2
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-portbld-freebsd7
  GCC host triplet: i686-portbld-freebsd7
GCC target triplet: i686-portbld-freebsd7


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38325



[Bug ada/38325] Long_Long_Float'Image returns a wrong value in some cases

2008-11-30 Thread bechir dot zalila at gmail dot com


--- Comment #2 from bechir dot zalila at gmail dot com  2008-11-30 10:27 
---
(In reply to comment #1)
> 0.1 is not exactly representable in a binary float format.
> 

Sure, but in former versions of GNAT-GCC (4.2.X), the expected value
(1.0E-01) was displayed.


-- 

bechir dot zalila at gmail dot com changed:

   What|Removed |Added

 CC|    |bechir dot zalila at gmail
   |        |dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38325



[Bug ada/40166] New: Ada compiler unable to build libraries

2009-05-16 Thread bechir dot zalila at gmail dot com
Due to the change given below. Ada compiler under all platforms is no longer
able to build libraries. The path to TOOLS_TARGET_PAIRS is incorrect in
gnattools/Makefile.in resulting in the use of the dummy mlib-tgt-specific.adb
for all platforms.


r144463 | schwab | 2009-02-27 10:54:25 +0100 (Ven, 27 fév 2009) | 12 lines

gnattools/:
* Makefile.in (fsrcdir): Point to gcc directory, not gcc/ada.
(INCLUDES_FOR_SUBDIR): Adjust.
(ADA_INCLUDES_FOR_SUBDIR): Adjust.


-- 
   Summary: Ada compiler unable to build libraries
   Product: gcc
   Version: 4.4.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: all
  GCC host triplet: all
GCC target triplet: all


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40166



[Bug ada/40166] Ada compiler unable to build libraries

2009-05-16 Thread bechir dot zalila at gmail dot com


--- Comment #1 from bechir dot zalila at gmail dot com  2009-05-16 07:42 
---
Created an attachment (id=17881)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17881&action=view)
A patchfile that fixes the problem

A patchfile that fixes the problem


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40166



[Bug ada/40166] Ada compiler unable to build libraries

2009-05-16 Thread bechir dot zalila at gmail dot com


--- Comment #2 from bechir dot zalila at gmail dot com  2009-05-16 07:43 
---
(In reply to comment #1)
> Created an attachment (id=17881)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17881&action=view) [edit]
> A patchfile that fixes the problem

It would be great to fix the problem in the trunk as well as in the GCC_4_4
branch.


-- 

bechir dot zalila at gmail dot com changed:

   What|Removed |Added

 CC|        |bechir dot zalila at gmail
   |        |dot com
   Severity|normal  |blocker


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40166



[Bug ada/40166] [4.4/4.5 regression] Ada compiler unable to build libraries

2009-05-16 Thread bechir dot zalila at gmail dot com


--- Comment #3 from bechir dot zalila at gmail dot com  2009-05-16 08:15 
---
Created an attachment (id=17882)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17882&action=view)
A correctly formatted version of the patch

A correctly formatted version of the patch


-- 

bechir dot zalila at gmail dot com changed:

   What|Removed |Added

  Attachment #17881|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40166



[Bug ada/35572] New: POSIX complient putenv() requires its argument NOT to be free'ed

2008-03-13 Thread bechir dot zalila at gmail dot com
In Darwin9 (Mac OS X Leopard), the new implementation of putenv() does not
duplicate its argument. Thus, this argument must not be deallocate in
gcc/ada/env.c (__gnat_setenv())

Deallocating this argument will corrupt the environment memory causing several
program (gnatmake will be unable to locate gcc, gnatbind or gnatlink).


-- 
   Summary: POSIX complient putenv() requires its argument NOT to be
free'ed
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: critical
  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-darwin9
  GCC host triplet: i686-apple-darwin9
GCC target triplet: i686-apple-darwin9


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35572



[Bug ada/35572] POSIX complient putenv() requires its argument NOT to be free'ed

2008-03-13 Thread bechir dot zalila at gmail dot com


--- Comment #1 from bechir dot zalila at gmail dot com  2008-03-13 16:35 
---
Created an attachment (id=15308)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15308&action=view)
patchfile that solves the problem


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35572



[Bug ada/34284] New: Missing dynamic library support for GNAT 4.3.0 on x86-*-Darwin8

2007-11-29 Thread bechir dot zalila at gmail dot com
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 x..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  <[EMAIL PROTECTED]>

* 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.adbhttp://gcc.gnu.org/bugzilla/show_bug.cgi?id=34284



[Bug ada/34284] Missing dynamic library support for GNAT 4.3.0 on x86-*-Darwin8

2007-11-29 Thread bechir dot zalila at gmail dot com


--- Comment #1 from bechir dot zalila at gmail dot com  2007-11-29 10:09 
---
Created an attachment (id=14660)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14660&action=view)
Ada spec


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34284



[Bug ada/34284] Missing dynamic library support for GNAT 4.3.0 on x86-*-Darwin8

2007-11-29 Thread bechir dot zalila at gmail dot com


--- Comment #2 from bechir dot zalila at gmail dot com  2007-11-29 10:09 
---
Created an attachment (id=14661)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14661&action=view)
Ada package body


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34284



[Bug ada/34284] Missing dynamic library support for GNAT 4.3.0 on x86-*-Darwin8

2007-11-29 Thread bechir dot zalila at gmail dot com


--- Comment #3 from bechir dot zalila at gmail dot com  2007-11-29 10:10 
---
Created an attachment (id=14662)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14662&action=view)
Ada library project file


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34284



[Bug ada/34284] Missing dynamic library support for GNAT 4.3.0 on x86-*-Darwin8

2007-11-29 Thread bechir dot zalila at gmail dot com


--- Comment #4 from bechir dot zalila at gmail dot com  2007-11-29 10:11 
---
Created an attachment (id=14663)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14663&action=view)
Patch to solve the bug


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34284



[Bug ada/34284] Missing dynamic library support for GNAT 4.3.0 on x86-*-Darwin8

2007-11-29 Thread bechir dot zalila at gmail dot com


--- Comment #5 from bechir dot zalila at gmail dot com  2007-11-29 10:17 
---
I did not know that the attaching file to a bug report comes after the commit. 

I reattached the files I gave as plain text in the bug report body.

Sorry :-)


-- 

bechir dot zalila at gmail dot com changed:

   What|Removed |Added

 CC||bechir dot zalila at gmail
   ||dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34284



[Bug ada/34289] New: Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-11-29 Thread bechir dot zalila at gmail dot com
Hi,

When recompiling an Ada file (attachements p.ads p.adb) using "-s" option for
gnatmake. The object file is systemtically rebuild even if it is up-to-date and
if even the compiler flags have not changed.

* How to reproduce the bug:
===

INPUT FILES:


Attached p.ads and p.adb

COMMAND LINE:
=

Two successive executions of:

gnatmake -s p.adb

EXPECTED BEHAVIOR:
==

first: gnatmake -s p.adb

gcc -c p.adb

second: gnatmake -s p.adb

 (object file is up to date, thus it is not recompiled)

ACTUAL BEHAVIOR:


first: gnatmake -s p.adb

gcc -c p.adb

second: gnatmake -s p.adb

gcc -c p.adb

Object file is recompiled systematically at each execution

MINI DIAGNOSTIC:


If we use the -v flag of gnatmake, we get the following output:

GNATMAKE  4.3.0 20071119 (experimental)
Copyright (C) 1995-2007, Free Software Foundation, Inc.
  "p.ali" being checked ...
  -> "p.adb" different number of switches
-mmacosx-version-min=10.4

gcc -c p.adb
End of compilation

The command line option '-mmacosx-version-min=10.4' is added automatically 
by gcc when calling gnat1.

Passing -v to gcc (gcc -v -c p.adb) gives the following (truncated) output:

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)

...

.../gnat1 -quiet -dumpbase p.adb -mmacosx-version-min=10.4 -mtune=generic -fPIC
p.adb -o /var/tmp//ccqsMDI3.s

...

There are indeed several options added by gcc to gnat1 (especially
-mmacosx-version-min=10.4 and -mtune=generic). But for some reason, only
-mmacosx-version-min=10.4 causes the problem.

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 x..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


-- 
   Summary: Systematic recompilation of up-to-date object files when
using the "-s" gnatmake option 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=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-11-29 Thread bechir dot zalila at gmail dot com


--- Comment #1 from bechir dot zalila at gmail dot com  2007-11-29 12:01 
---
Created an attachment (id=14665)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14665&action=view)
Ada package spec


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-11-29 Thread bechir dot zalila at gmail dot com


--- Comment #2 from bechir dot zalila at gmail dot com  2007-11-29 12:01 
---
Created an attachment (id=14666)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14666&action=view)
Ada package body


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-11-30 Thread bechir dot zalila at gmail dot com


--- Comment #4 from bechir dot zalila at gmail dot com  2007-11-30 09:30 
---
Created an attachment (id=14670)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14670&action=view)
Patchfile that solves the poblem

This patchfile is valid only if the order among -g* and -m* switches is not
important.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-11-30 Thread bechir dot zalila at gmail dot com


--- Comment #3 from bechir dot zalila at gmail dot com  2007-11-30 09:19 
---
In gcc/config/i386/darwin.h, we can see:

#define CC1_SPEC "%(cc1_cpu) \
  %{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \
  %{!mmacosx-version-min=*:-mmacosx-version-min=%(darwin_minversion)} \
  %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols
}}"

which cintains the addition of -mmacosx-version-min=... if it is not given,

In gcc/ada/lang-spec.h we can see the following:

%{O*} %{W*} %{w} %{p} %{pg:-p} %{a} %{f*} %{d*} %{g*&m*} "
#if defined(TARGET_VXWORKS_RTP)
   "%{fRTS=rtp:-mrtp} "
#endif
#if CONFIG_DUAL_EXCEPTIONS
   "%{fRTS=sjlj:-fsjlj} "
#endif
   "%1 %{!S:%{o*:%w%*-gnatO}} \

The %1 (processing of CC1_SPEC) comes after the %{g*&m*} which should result in
adding the -mmacosx-version-min=... after all options that begins with -g* and
especially -gnatez, and it should not be added in the .ali file. For some
reason, the -mmacosx-version-min=... is added before all options that begins
with -g...

I replaced %{g*&m*} by %{g*} %{m*} in lang-specs.h and this solved the problem.
However, I don't know whether its is very important to conserve the order among
-g* and -m* switches when passing them to gnat1. The change 83658 did not say
why:

* lang-specs.h: Keep -g and -m switches in the same order, and as the
last switches.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-12-02 Thread bechir dot zalila at gmail dot com


--- Comment #7 from bechir dot zalila at gmail dot com  2007-12-02 09:57 
---
(In reply to comment #6)
> Bechir, could you please add the output of "gnatmake -s p.adb -v -cargs -v"?
> 

Here it is:

% gnatmake -s p.adb -cargs -v
gcc -c -v p.adb
Using built-in specs.
Target: i686-apple-darwin8
Configured with: ../gcc_trunk_clean/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 20071130 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-c' '-v' '-gnatez'
'-mtune=generic'

/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../libexec/gcc/i686-apple-darwin8/4.3.0/gnat1
-quiet -dumpbase p.adb -mmacosx-version-min=10.4 -gnatez -mtune=generic -fPIC
p.adb -o /var/tmp//ccyfAlPK.s
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-c' '-v' '-gnatez'
'-mtune=generic'
 as -arch i386 -force_cpusubtype_ALL -o p.o /var/tmp//ccyfAlPK.s
COMPILER_PATH=/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../libexec/gcc/i686-apple-darwin8/4.3.0/:/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../libexec/gcc/:/usr/libexec/gcc/i686-apple-darwin8/:/usr/lib/gcc/i686-apple-darwin8/
LIBRARY_PATH=/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../lib/gcc/i686-apple-darwin8/4.3.0/:/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../lib/gcc/:/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../lib/gcc/i686-apple-darwin8/4.3.0/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-c' '-v' '-gnatez'
'-mtune=generic'
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-c' '-v' '-gnatez'
'-mtune=generic'


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-12-02 Thread bechir dot zalila at gmail dot com


--- Comment #8 from bechir dot zalila at gmail dot com  2007-12-02 10:00 
---
(In reply to comment #7)
> (In reply to comment #6)
> > Bechir, could you please add the output of "gnatmake -s p.adb -v -cargs -v"?
> > 
> 
> Here it is:

Sorry, forgot the first -v

% gnatmake -s p.adb -v -cargs -v

GNATMAKE  4.3.0 20071130 (experimental)
Copyright (C) 1995-2007, Free Software Foundation, Inc.
  "p.ali" being checked ...
  -> "p.adb" different number of switches
-mmacosx-version-min=10.4

gcc -c -v p.adb
Using built-in specs.
Target: i686-apple-darwin8
Configured with: ../gcc_trunk_clean/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 20071130 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-c' '-v' '-gnatez'
'-mtune=generic'

/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../libexec/gcc/i686-apple-darwin8/4.3.0/gnat1
-quiet -dumpbase p.adb -mmacosx-version-min=10.4 -gnatez -mtune=generic -fPIC
p.adb -o /var/tmp//ccu2zkMZ.s
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-c' '-v' '-gnatez'
'-mtune=generic'
 as -arch i386 -force_cpusubtype_ALL -o p.o /var/tmp//ccu2zkMZ.s
COMPILER_PATH=/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../libexec/gcc/i686-apple-darwin8/4.3.0/:/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../libexec/gcc/:/usr/libexec/gcc/i686-apple-darwin8/:/usr/lib/gcc/i686-apple-darwin8/
LIBRARY_PATH=/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../lib/gcc/i686-apple-darwin8/4.3.0/:/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../lib/gcc/:/Volumes/Stock/Dev/gcc-4.3_trunk/bin/../lib/gcc/i686-apple-darwin8/4.3.0/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-c' '-v' '-gnatez'
'-mtune=generic'
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.4' '-c' '-v' '-gnatez'
'-mtune=generic'
End of compilation


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-12-03 Thread bechir dot zalila at gmail dot com


--- Comment #11 from bechir dot zalila at gmail dot com  2007-12-03 14:00 
---
After a lot of investigation, I succeeded to isolate the problem. The added
-mmacosx-min-version is not done when processing the CC1_SPEC: It is done in
the main function in gcc.c using the GCC_DRIVER_HOST_INITIALIZATION macro.

In gcc.c (function main):

#ifdef GCC_DRIVER_HOST_INITIALIZATION
  /* Perform host dependent initialization when needed.  */
  GCC_DRIVER_HOST_INITIALIZATION;
#endif

For the darwin (ppc + x86): in config/darwin.g:

extern void darwin_default_min_version (int * argc, char *** argv);
#define GCC_DRIVER_HOST_INITIALIZATION \
  darwin_default_min_version (&argc, &argv)
#endif /* CROSS_DIRECTORY_STRUCTURE */

And finally the darwin_default_min_version function defined in
config/darwin-driver.c. This function inserts -mmacosx-version-min
*at the beginning* of argv, just after the command name (argv[1])

I Attached a patchfile (gcc_ada.diff) for the GNAT frontend that solves the
problem


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-12-03 Thread bechir dot zalila at gmail dot com


--- Comment #10 from bechir dot zalila at gmail dot com  2007-12-03 13:54 
---
Created an attachment (id=14689)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14689&action=view)
Patchfile that solves the problem

This patchfile solves the problem by adding a new switch (-gnatea) analog to 
-gnatez . -gnatea and -gnatez surround the switches we want to store in the ALI
file.


-- 

bechir dot zalila at gmail dot com changed:

   What|Removed |Added

  Attachment #14670|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-12-03 Thread bechir dot zalila at gmail dot com


--- Comment #12 from bechir dot zalila at gmail dot com  2007-12-03 14:23 
---
Created an attachment (id=14690)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14690&action=view)
Patchfile that solves the problem

Fixed a typo in comment


-- 

bechir dot zalila at gmail dot com changed:

   What|Removed |Added

  Attachment #14689|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34289] Systematic recompilation of up-to-date object files when using the "-s" gnatmake option GNAT 4.3.0 on x86-*-Darwin8

2007-12-03 Thread bechir dot zalila at gmail dot com


--- Comment #13 from bechir dot zalila at gmail dot com  2007-12-03 15:26 
---
Created an attachment (id=14693)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14693&action=view)
Patchfile that solves the problem

Added the support of registring non-(g*&m*) switches


-- 

bechir dot zalila at gmail dot com changed:

   What|Removed |Added

  Attachment #14690|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34289



[Bug ada/34358] New: Dynamic library created in Object_Dir instead of Library_Dir in *-darwin*

2007-12-06 Thread bechir dot zalila at gmail dot com
Hi,

I've found the following bug in GNAT when building dynamic libraries using
project files:

Ada spec (p.ads)


package P is

   procedure Dummy;

end P;

Ada body (p.adb)


package body P is

   ---
   -- Dummy --
   ---

   procedure Dummy is
   begin
  null;
   end Dummy;

end P;

Project file (lib_project.gpr)
===

project Lib_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 Lib_Project;

Command:
=

% gnatmake -p -P lib_project.gpr
% ls objects libs

Expected behavior:
==

% gnatmake -p -P lib_project.gpr
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 lib_project
/Volumes/Stock/Dev/gcc-4.3_trunk/bin/gcc -dynamiclib -o
/Volumes/Stock/Dev/gnat_bug_report/libs/libmy_lib.dylib
-L/Volumes/Stock/Dev/gcc-4.3_trunk/lib/gcc/i686-apple-darwin8/4.3.0/adalib/
-fPIC
-L/Volumes/Stock/Dev/gcc-4.3_trunk/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
/usr/bin/ld: warning can't open dynamic library: /libgcc_s.1.dylib referenced
from:
/Volumes/Stock/Dev/gcc-4.3_trunk/lib/gcc/i686-apple-darwin8/4.3.0/adalib//libgnat-4.3.dylib
(checking for undefined symbols may be affected) (No such file or directory,
errno = 2)

[The warning issued by the linker here is another independant bug (see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30572)]

% ls objects libs
libs:
libmy_lib.dylib p.ali

objects:
p.ali   p.o

Actual behavior:


% gnatmake -p -P lib_project.gpr
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 lib_project
/Volumes/Stock/Dev/gcc-4.3_trunk/bin/gcc -dynamiclib -o libmy_lib.dylib
-L/Volumes/Stock/Dev/gcc-4.3_trunk/lib/gcc/i686-apple-darwin8/4.3.0/adalib/
-fPIC
-L/Volumes/Stock/Dev/gcc-4.3_trunk/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
/usr/bin/ld: warning can't open dynamic library: /libgcc_s.1.dylib referenced
from:
/Volumes/Stock/Dev/gcc-4.3_trunk/lib/gcc/i686-apple-darwin8/4.3.0/adalib//libgnat-4.3.dylib
(checking for undefined symbols may be affected) (No such file or directory,
errno = 2)

% ls objects libs
libs:
p.ali

objects:
libmy_lib.dylib p.ali   p.o


The library file libmy_lib.dylib is created in the object directory. This
causes a problem if we want to link against this library...

The attached patch fixes this problem.

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 20071206 (experimental) (GCC)

* the system type (uname -a);

Darwin x..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


-- 
   Summary: Dynamic library created in Object_Dir instead of
Library_Dir in *-darwin*
   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=34358



[Bug ada/34358] Dynamic library created in Object_Dir instead of Library_Dir in *-darwin*

2007-12-06 Thread bechir dot zalila at gmail dot com


--- Comment #1 from bechir dot zalila at gmail dot com  2007-12-06 13:48 
---
Created an attachment (id=14703)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14703&action=view)
Patch file that solves the problem


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34358