[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#487396: Missing link error on ARM



Package: g++-4.3
Version: 4.3.1-2
Severity: normal

Hello,

while trying to investigate why libept does not build on ARM, I came up
with the attached source code.  On any system, it gives a link time
error while building it.  On ARM, only when invoking g++, only with
-fPIC, it links fine, then running the program segfaults.

To reproduce, install g++ 4.3 on ARM, then run:

  g++-4.3 -fPIC -o main1 main1.cpp

We have been working on minimising this test code since a whole day, and
we did not manage to make it smaller than this.  Fiddling with this code
further (like removing a template parameter, or removing the std
namespace) makes the linker error properly appear.


Ciao,

Enrico


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.25-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
namespace std {
  template<typename _Alloc>
    class allocator;

  template<class _CharT>
    struct char_traits;

  template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> >
    class basic_string
    {
    public:
      basic_string() {}
      ~basic_string() {}

      basic_string&
      operator=(const _CharT* __s)
      {
 return this->assign(__s, 1);
       }

      basic_string&
      assign(const _CharT* __s, unsigned int __n);
  };

  typedef basic_string<char> string;
}

int main( int argc, char **argv ) {
    std::string t;
    t = "";
    return 0;
}

Reply to: