public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/55946] New: Wrong GNAT tools used on build of gnattools [native-cross]
@ 2013-01-11 20:02 gregnietsky at gmail dot com
  2013-01-27 19:49 ` [Bug ada/55946] " chris.gccbugzilla at breisch dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gregnietsky at gmail dot com @ 2013-01-11 20:02 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55946
           Summary: Wrong GNAT tools used on build of gnattools
                    [native-cross]
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gregnietsky@gmail.com


Created attachment 29151
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29151
Workaround patch sutible for my needs

First time ive added GNAT/ADA to the chain i bootstraped 4.8.0 20130107 from
ada core i then rebuilt all the cross chains i have for ARM/MIPS/PPC this went
fine
building native i686 from x86-64 works fine ....

trying to build a native aarch64 failed [i did have a native cross compiler in
place with aarch64-linux-gnu-gnat.... and did test they work]

please note that this is not a solution but a workaround im happy with it
requires 

1)gnatmake in the path
2)<HOST>-gnatmake/link/bind/tls [symlinks added to native to allow normal
cross]

the solution will require changes to autotools IMHO

problems ...

1)building xgnatugn is done with aarch64-linux-gnu-gnatmake this is not correct
as it needs to use gnatmake on the build system as it executes this program to
generate docs the following hunk solves this but is not portable possibly
adding BUILD_GNATMAKE is better

gcc/ada/gcc-interface/Make-lang.in
@@ -621,7 +619,7 @@
 ada/doctools/xgnatugn$(build_exeext): ada/xgnatugn.adb
        -$(MKDIR) ada/doctools
        $(CP) $^ ada/doctools
-       cd ada/doctools && $(GNATMAKE) -q xgnatugn
+       cd ada/doctools && gnatmake -q xgnatugn

2)Wrong libs [native build] are used to build gnattools and the native tools
are used

setting
host = @host_cpu@-@host_os@

prefixing gnat tools with $(host)-

-RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
+RTS_DIR:=$(strip $(subst \,/,$(shell $(host)-gnatls -v | grep adalib )))

this seems to work till it bombs out complaining about

3)system.ads

pragma Restrictions (No_Implicit_Dynamic_Code);

causes failure as others dont honor it removing this allows complteion and
succesfull build


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug ada/55946] Wrong GNAT tools used on build of gnattools [native-cross]
  2013-01-11 20:02 [Bug ada/55946] New: Wrong GNAT tools used on build of gnattools [native-cross] gregnietsky at gmail dot com
@ 2013-01-27 19:49 ` chris.gccbugzilla at breisch dot org
  2013-11-06 18:17 ` [Bug ada/55946] wrong tools used for " ebotcazou at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: chris.gccbugzilla at breisch dot org @ 2013-01-27 19:49 UTC (permalink / raw)
  To: gcc-bugs


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

Chris J. Breisch <chris.gccbugzilla at breisch dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chris.gccbugzilla at
                   |                            |breisch dot org

--- Comment #1 from Chris J. Breisch <chris.gccbugzilla at breisch dot org> 2013-01-27 19:49:05 UTC ---
I can verify this issue. It occurs when building the native gcc/gnat using the
cross-compiler.

However, the patch doesn't quite work for me.
The patch to gnattools/Makefile appears wrong:
+host = @host_cpu@-@host_os@

Shouldn't this just be
+host = @host@
?

That's what I needed.

However, I think this is masking the real problem.

>From later in the patch...(comments are from the original Makefile)

 # put the host RTS dir first in the PATH to hide the default runtime
 # files that are among the sources
 # FIXME: This should be done in configure.
-RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
+RTS_DIR:=$(strip $(subst \,/,$(shell $(host)-gnatls -v | grep adalib )))

The original bug report is correct. We should absolutely not be running the
regular gnatls on the host here, but the one from the cross compiler. Hence the
patch. For me the name of the cross compiler gnatls uses the complete host
triple. Obviously not for the original poster. I suspect that there's no simple
solution here that will work for everyone and the original comment in the
Makefile is correct.

FIXME: This should be done in configure.

I think until this is properly handled in configure, problems will still occur.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug ada/55946] wrong tools used for build of gnattools [native-cross]
  2013-01-11 20:02 [Bug ada/55946] New: Wrong GNAT tools used on build of gnattools [native-cross] gregnietsky at gmail dot com
  2013-01-27 19:49 ` [Bug ada/55946] " chris.gccbugzilla at breisch dot org
@ 2013-11-06 18:17 ` ebotcazou at gcc dot gnu.org
  2013-12-11 13:24 ` ebotcazou at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2013-11-06 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-06
                 CC|                            |ebotcazou at gcc dot gnu.org
            Summary|Wrong GNAT tools used on    |wrong tools used for build
                   |build of gnattools          |of gnattools [native-cross]
                   |[native-cross]              |
     Ever confirmed|0                           |1

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Related work done at http://gcc.gnu.org/ml/gcc-patches/2013-11/msg00146.html


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug ada/55946] wrong tools used for build of gnattools [native-cross]
  2013-01-11 20:02 [Bug ada/55946] New: Wrong GNAT tools used on build of gnattools [native-cross] gregnietsky at gmail dot com
  2013-01-27 19:49 ` [Bug ada/55946] " chris.gccbugzilla at breisch dot org
  2013-11-06 18:17 ` [Bug ada/55946] wrong tools used for " ebotcazou at gcc dot gnu.org
@ 2013-12-11 13:24 ` ebotcazou at gcc dot gnu.org
  2013-12-12 22:50 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2013-12-11 13:24 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ebotcazou at gcc dot gnu.org

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
I'm going to install something.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug ada/55946] wrong tools used for build of gnattools [native-cross]
  2013-01-11 20:02 [Bug ada/55946] New: Wrong GNAT tools used on build of gnattools [native-cross] gregnietsky at gmail dot com
                   ` (2 preceding siblings ...)
  2013-12-11 13:24 ` ebotcazou at gcc dot gnu.org
@ 2013-12-12 22:50 ` ebotcazou at gcc dot gnu.org
  2013-12-12 22:53 ` ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2013-12-12 22:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Author: ebotcazou
Date: Thu Dec 12 22:50:07 2013
New Revision: 205945

URL: http://gcc.gnu.org/viewcvs?rev=205945&root=gcc&view=rev
Log:
    PR ada/55946
gnattools/
    * Makefile.in (host): Define.
    (host_alias): Likewise.
    (TOOLS_FLAGS_TO_PASS_RE): Add LDFLAGS.
    (GNATMAKE_FOR_HOST): Define.
    (GNATLINK_FOR_HOST): Likewise.
    (GNATBIND_FOR_HOST): Likewise.
    (GNATLS_FOR_HOST): Likewise.
    (RTS_DIR): Move around and use GNATLS_FOR_HOST.
    (TOOLS_FLAGS_TO_PASS_CROSS): Use the other *_HOST variables.
gcc/ada/
    * gcc-interface/Make-lang.in (ada/doctools/xgnatugn): Use gnatmake.
    * gcc-interface/Makefile.in (GCC_LINK): Add LDFLAGS.
    (../../gnatmake): Remove LDFLAGS.
    (../../gnatlink): Likewise.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/gcc-interface/Make-lang.in
    trunk/gcc/ada/gcc-interface/Makefile.in
    trunk/gnattools/ChangeLog
    trunk/gnattools/Makefile.in


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug ada/55946] wrong tools used for build of gnattools [native-cross]
  2013-01-11 20:02 [Bug ada/55946] New: Wrong GNAT tools used on build of gnattools [native-cross] gregnietsky at gmail dot com
                   ` (3 preceding siblings ...)
  2013-12-12 22:50 ` ebotcazou at gcc dot gnu.org
@ 2013-12-12 22:53 ` ebotcazou at gcc dot gnu.org
  2013-12-12 22:57 ` ebotcazou at gcc dot gnu.org
  2014-01-14 10:35 ` ebotcazou at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2013-12-12 22:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Author: ebotcazou
Date: Thu Dec 12 22:53:43 2013
New Revision: 205947

URL: http://gcc.gnu.org/viewcvs?rev=205947&root=gcc&view=rev
Log:
    PR ada/55946
gnattools/
    * Makefile.in (host): Define.
    (host_alias): Likewise.
    (TOOLS_FLAGS_TO_PASS_RE): Add LDFLAGS.
    (GNATMAKE_FOR_HOST): Define.
    (GNATLINK_FOR_HOST): Likewise.
    (GNATBIND_FOR_HOST): Likewise.
    (GNATLS_FOR_HOST): Likewise.
    (RTS_DIR): Move around and use GNATLS_FOR_HOST.
    (TOOLS_FLAGS_TO_PASS_CROSS): Use the other *_HOST variables.
gcc/ada/
    * gcc-interface/Make-lang.in (ada/doctools/xgnatugn): Use gnatmake.
    * gcc-interface/Makefile.in (GCC_LINK): Add LDFLAGS.
    (../../gnatmake): Remove LDFLAGS.
    (../../gnatlink): Likewise.

Modified:
    branches/gcc-4_8-branch/gcc/ada/ChangeLog
    branches/gcc-4_8-branch/gcc/ada/gcc-interface/Make-lang.in
    branches/gcc-4_8-branch/gcc/ada/gcc-interface/Makefile.in
    branches/gcc-4_8-branch/gnattools/ChangeLog
    branches/gcc-4_8-branch/gnattools/Makefile.in


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug ada/55946] wrong tools used for build of gnattools [native-cross]
  2013-01-11 20:02 [Bug ada/55946] New: Wrong GNAT tools used on build of gnattools [native-cross] gregnietsky at gmail dot com
                   ` (4 preceding siblings ...)
  2013-12-12 22:53 ` ebotcazou at gcc dot gnu.org
@ 2013-12-12 22:57 ` ebotcazou at gcc dot gnu.org
  2014-01-14 10:35 ` ebotcazou at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2013-12-12 22:57 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.8.3

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This should be fixed now.  Note that the violation of No_Implicit_Dynamic_Code
comes from the misconfiguration of the host compiler: you need to add the
required bits to ada/gcc-interface/Makefile.in for an aarch64-based target.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug ada/55946] wrong tools used for build of gnattools [native-cross]
  2013-01-11 20:02 [Bug ada/55946] New: Wrong GNAT tools used on build of gnattools [native-cross] gregnietsky at gmail dot com
                   ` (5 preceding siblings ...)
  2013-12-12 22:57 ` ebotcazou at gcc dot gnu.org
@ 2014-01-14 10:35 ` ebotcazou at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2014-01-14 10:35 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alexpux at gmail dot com

--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
*** Bug 57795 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-01-14 10:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-11 20:02 [Bug ada/55946] New: Wrong GNAT tools used on build of gnattools [native-cross] gregnietsky at gmail dot com
2013-01-27 19:49 ` [Bug ada/55946] " chris.gccbugzilla at breisch dot org
2013-11-06 18:17 ` [Bug ada/55946] wrong tools used for " ebotcazou at gcc dot gnu.org
2013-12-11 13:24 ` ebotcazou at gcc dot gnu.org
2013-12-12 22:50 ` ebotcazou at gcc dot gnu.org
2013-12-12 22:53 ` ebotcazou at gcc dot gnu.org
2013-12-12 22:57 ` ebotcazou at gcc dot gnu.org
2014-01-14 10:35 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).