URL:
  <http://savannah.gnu.org/bugs/?28335>

                 Summary: [configure.ac] link error due to bad -Wl options
                 Project: GNU GRUB
            Submitted by: gsutre
            Submitted on: Fri 18 Dec 2009 01:22:21 PM GMT
                Category: Configuration
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: Bazaar - trunk
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

Hi,

In configure.ac, the definition TARGET_IMG_LDFLAGS_AC='-Wl,-N  -Wl,-Ttext,'
leads to an error when configure is run within the pkgsrc framework
(http://www.pkgsrc.org/).

The following patch solves this problem (at least in my environment):

--- configure.ac.orig   2009-12-18 02:59:13.000000000 +0100
+++ configure.ac
@@ -325,7 +325,7 @@ if test -f "${srcdir}/conf/${target_cpu}
 else
   TARGET_IMG_LDSCRIPT=
   TARGET_IMG_LDFLAGS='-Wl,-N  -Wl,-Ttext,'
-  TARGET_IMG_LDFLAGS_AC='-Wl,-N  -Wl,-Ttext,'
+  TARGET_IMG_LDFLAGS_AC='-Wl,-N'
 fi
 TARGET_IMG_CFLAGS=
 fi


Some details about the problem: the variable TARGET_IMG_LDFLAGS_AC is used in
the check that objcopy works for absolute addresses, and the following command
is issued by configure:

gcc [...] ${TARGET_IMG_LDFLAGS_AC} -Wl,-Ttext -Wl,$link_addr conftest.o -o
conftest.exec

which is expanded to:

gcc [...] -Wl,-N  -Wl,-Ttext, -Wl,-Ttext -Wl,$link_addr conftest.o -o
conftest.exec

which, within pkgsrc, gets normalized to:

gcc [...] -Wl,-N  -Wl,-Ttext -Wl,-Ttext -Wl,$link_addr conftest.o -o
conftest.exec

which gives the error:
ld: invalid hex number `-Ttext'

According to the pkgsrc mailing list [1], and this is consistent with gcc's
man page,

-Wl,-Ttext, -Wl,-Ttext

is semantically equivalent to

-Wl,-Text -Wl -Wl,-Text

and, indeed, gcc with the latter gives the same error (invalid hex number
`-Ttext').

[1] http://mail-index.netbsd.org/tech-pkg/2009/12/16/msg004521.html




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?28335>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-grub mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-grub

Reply via email to