<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: troubleshooting bus errors compiling with gcc 3.4.3 on 11.11 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903199#M701995</link>
    <description>This is from version 3.4.2 I got from &lt;A href="http://www.hp.com/go/gcc." target="_blank"&gt;http://www.hp.com/go/gcc.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;$ gcc -pthread -v test.c&lt;BR /&gt;...&lt;BR /&gt;/opt/local/libexec/gcc/hppa2.0w-hp-hpux11.11/3.4.2/cc1 -quiet -v -iprefix /opt/local/bin/../lib/gcc/hppa2.0w-hp-hpux11.11/3.4.2/ -D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L test.c -quiet -dumpbase test.c -auxbase test -version -o /var/tmp//ccYG5pet.s&lt;BR /&gt;...&lt;BR /&gt;$ gcc -dumpspecs | grep pthread&lt;BR /&gt;%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}&lt;BR /&gt;&lt;BR /&gt;If you specify -pthread it will add -D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L preprocessor flags.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 23 May 2005 19:26:29 GMT</pubDate>
    <dc:creator>Ermin Borovac</dc:creator>
    <dc:date>2005-05-23T19:26:29Z</dc:date>
    <item>
      <title>troubleshooting bus errors compiling with gcc 3.4.3 on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903195#M701991</link>
      <description>I am porting/compiling a working multithreaded app to HPUX 11.11 using gcc3.4.3 from the porting centre - binary install, as well as any dependent packages.  I have the latest cumulative linker patch installed.  &lt;BR /&gt;&lt;BR /&gt;I link the objects using:&lt;BR /&gt;&lt;BR /&gt;gcc -o foo f1.o f2.o f3.o -lpthread -lrt&lt;BR /&gt;&lt;BR /&gt;Upon running the application, I get a bus error whenever passing the address of a stack variable into a function call, e.g. main() calls f2_func(&amp;amp;stack_var).  Avoiding that by allocating the variable using malloc, I consistently get -1 returns from *all* system calls  with errno still 0.  These are obviously audited calls like mkdir("/tmp/foo",S_IRWXU) when foo does not exist&lt;BR /&gt;&lt;BR /&gt;The constituent objects are built with no command line options to gcc except -g:&lt;BR /&gt;&lt;BR /&gt;gcc -g -c -o f1.o f1.c (and so forth)&lt;BR /&gt;&lt;BR /&gt;Clearly there is some memory alignment problem in the first case and an application linking/compat problem in the latter, but I know not how to resolve then and my initial doc readings did not turn anything up.    Any help would be appreciated.  Thanks!&lt;BR /&gt;</description>
      <pubDate>Fri, 20 May 2005 10:04:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903195#M701991</guid>
      <dc:creator>Mark Roman</dc:creator>
      <dc:date>2005-05-20T10:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: troubleshooting bus errors compiling with gcc 3.4.3 on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903196#M701992</link>
      <description>Please try compiling your files with -mt or -pthread flags.&lt;BR /&gt;&lt;BR /&gt;-mt&lt;BR /&gt;-pthread&lt;BR /&gt;          &lt;BR /&gt;Add support for multithreading using the POSIX threads library. This option sets flags for both the preprocessor and linker.  It does not affect the thread safety of object code produced by the compiler or that of libraries supplied with it.  These are HP-UX specific flags.&lt;BR /&gt;</description>
      <pubDate>Sun, 22 May 2005 01:49:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903196#M701992</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-05-22T01:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: troubleshooting bus errors compiling with gcc 3.4.3 on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903197#M701993</link>
      <description>Those are not valid options for gcc, at least not the build out of the porting centre&lt;BR /&gt;&lt;BR /&gt;[root@chpux1]# make&lt;BR /&gt;gcc -mt -pthread -Wall -g   -c -o find.o find.c&lt;BR /&gt;cc1: error: invalid option `t'&lt;BR /&gt;gmake: *** [find.o] Error 1&lt;BR /&gt;[root@chpux1]# gcc -mmt -Wall -g -c -o find.o find.c&lt;BR /&gt;cc1: error: invalid option `mt'&lt;BR /&gt;[root@chpux1]# gcc --version&lt;BR /&gt;gcc (GCC) 3.4.3&lt;BR /&gt;Copyright (C) 2004 Free Software Foundation, Inc.&lt;BR /&gt;This is free software; see the source for copying conditions.  There is NO&lt;BR /&gt;warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&lt;BR /&gt;                                                                                                                                                                            &lt;BR /&gt;[root@chpux1]# uname -s -r -m&lt;BR /&gt;HP-UX B.11.11 9000/800&lt;BR /&gt;[root@chpux1]#&lt;BR /&gt;                                                                                                                                                                            &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 23 May 2005 09:36:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903197#M701993</guid>
      <dc:creator>Mark Roman</dc:creator>
      <dc:date>2005-05-23T09:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: troubleshooting bus errors compiling with gcc 3.4.3 on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903198#M701994</link>
      <description>It seems that the -D_REENTRANT flag is required to flip on support for the non-stubbed versions.  While this does not solve the bus error problem, it does cause the correct system call prototypes to be used, and later the enabled multithreaded system calls to be linked into the binary.&lt;BR /&gt;</description>
      <pubDate>Mon, 23 May 2005 09:43:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903198#M701994</guid>
      <dc:creator>Mark Roman</dc:creator>
      <dc:date>2005-05-23T09:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: troubleshooting bus errors compiling with gcc 3.4.3 on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903199#M701995</link>
      <description>This is from version 3.4.2 I got from &lt;A href="http://www.hp.com/go/gcc." target="_blank"&gt;http://www.hp.com/go/gcc.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;$ gcc -pthread -v test.c&lt;BR /&gt;...&lt;BR /&gt;/opt/local/libexec/gcc/hppa2.0w-hp-hpux11.11/3.4.2/cc1 -quiet -v -iprefix /opt/local/bin/../lib/gcc/hppa2.0w-hp-hpux11.11/3.4.2/ -D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L test.c -quiet -dumpbase test.c -auxbase test -version -o /var/tmp//ccYG5pet.s&lt;BR /&gt;...&lt;BR /&gt;$ gcc -dumpspecs | grep pthread&lt;BR /&gt;%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}&lt;BR /&gt;&lt;BR /&gt;If you specify -pthread it will add -D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L preprocessor flags.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 23 May 2005 19:26:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903199#M701995</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-05-23T19:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: troubleshooting bus errors compiling with gcc 3.4.3 on 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903200#M701996</link>
      <description>The flags give me correct compilation for my application - I am working through the bus error and will open another thread with any specific questions there, as they do not appear to be related to the compiling/linking problem per se.  Thanks for the help!</description>
      <pubDate>Tue, 24 May 2005 13:22:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/troubleshooting-bus-errors-compiling-with-gcc-3-4-3-on-11-11/m-p/4903200#M701996</guid>
      <dc:creator>Mark Roman</dc:creator>
      <dc:date>2005-05-24T13:22:49Z</dc:date>
    </item>
  </channel>
</rss>

