_GLIBCXX_PROFILE on non-Linux?

Gerald Pfeifer gerald@pfeifer.com
Sun Jan 17 21:11:00 GMT 2010


I am wondering whether there is anything that we may need to do to enable
_GLIBCXX_PROFILE on non-Linux platforms, specifically FreeBSD?

On my GCC tester, I am seeing something like the following for both 
complex and simple programs:

  % .../g++ -D_GLIBCXX_PROFILE x.cc
  /var/tmp//ccDvxnqv.o(.gnu.linkonce.t._ZN13__gnu_profile6__turnENS_12__state_typeE+0x1f): 
  In function `__gnu_profile::__turn(__gnu_profile::__state_type)':
  : undefined reference to `__sync_val_compare_and_swap_4'

Here is the simple test program I used:

  #include <iostream>
  #include <vector>

  main() {
    const char *s = "Hello world!\n";
 
    std::vector<char> v;

    for(s; *s != '\0'; s++)
      v.push_back(*s);

    for(std::vector<char>::const_iterator i = v.begin(); i != v.end(); i++)
      std::cout << *i;
  }

Google did not trigger anything, so I am not sure whether this is just
a case of problem between chair and keyboard or something where we need
to adjust something (and be it the documentation).

Gerald



More information about the Libstdc++ mailing list