public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
@ 2012-10-19  1:44 Rick Springob
  2012-10-26 15:21 ` Rick Springob
  0 siblings, 1 reply; 10+ messages in thread
From: Rick Springob @ 2012-10-19  1:44 UTC (permalink / raw)
  To: gcc-help

I need to use an older version of gcc in order to help debug an old,
released build. We will also run new builds with gcc-4.3.5  for
compatibility reasons.  The original build machine is toast. I am
working in a newly provisioned machine running AIX 6.1. The gcc-4.3.5
that is available via rpm uses the aix thread model and I need to
build with pthreads.  I have built pre-req's bintuils-2.22,
mpfr-3.1.1-1, gmp-5.0.5.

I am currently trying to bootstrap using gcc-4.3.5-1. I have tried the
native compiler, xlc, but had other errors and am back to using gcc.
(Not to mention that the documentation told me that using gcc was an
better path to follow.)

Question #1) --enable-threads=posix does not seem to work. Is this
flag supported or perhaps I am using it incorrectly?

Here is my configure statement:

/opt/gcc_work/gcc-4.3.5-src/
configure --disable-shared --enable-static --enable-threads=posix
--prefix=/opt/freeware/gcc_4_3_5 --exec-prefix=/opt/freeware/gcc_4_3_5
-enable-languages=c,c++ --srcdir=/opt/gcc_work/gcc-4.3.5-src
--includedir=/opt/gcc_work/gcc-4.3.5-src/include "CFLAGS=-pthread"
"CXXFLAGS=-pthread"

In <build dir>/config.log I see:

"
Configured with: ../gcc-4.3.5/configure --with-as=/usr/bin/as
--with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=
/opt/freeware --enable-threads --enable-version-specific-runtime-libs
--disable-nls --enable-decimal-float=dpd --host=powerpc-
ibm-aix6.1.0.0
Thread model: aix
"

The thread model might have been an omen that leads to my second question.

Question #2) How can I propagate the use of pthreads into the build?

The build is currently dying in the intl directory. Here is the
trouble area from <build dir>/intl/config.log:

"
configure:2092:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
-B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/ -B/opt/freeware/g
cc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -V </dev/null >&5
xgcc: '-V' must come at the start of the command line
configure:2095: $? = 1
configure:2118: checking for C compiler default output file name
configure:2121:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
-B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
-B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
-Wl,-bbigtoc conftest.c  >&5
ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_wait
ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_broadcast
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_settype
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_destroy
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_trylock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_setspecific
ld: 0711-317 ERROR: Undefined symbol: .pthread_getspecific
ld: 0711-317 ERROR: Undefined symbol: .pthread_key_delete
ld: 0711-317 ERROR: Undefined symbol: .pthread_key_create
ld: 0711-317 ERROR: Undefined symbol: .pthread_once
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
configure:2124: $? = 1
"

If I add "-lpthread" to the command that configure ran and run it
myself, it works:

"
bash-3.2# /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
-B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
-B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
-Wl,-bbigtoc -lpthread /tmp/conftest.c
bash-3.2# echo $?
0
"

Thanks,
 -Rick

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

* Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
  2012-10-19  1:44 problems building gcc-4.3.5-1 on AIX 6.1 with pthreads Rick Springob
@ 2012-10-26 15:21 ` Rick Springob
  2012-10-26 21:44   ` Jonathan Wakely
  0 siblings, 1 reply; 10+ messages in thread
From: Rick Springob @ 2012-10-26 15:21 UTC (permalink / raw)
  To: gcc-help

On Thu, Oct 18, 2012 at 4:08 PM, Rick Springob <rspringob@gmail.com> wrote:
> I need to use an older version of gcc in order to help debug an old,
> released build. We will also run new builds with gcc-4.3.5  for
> compatibility reasons.  The original build machine is toast. I am
> working in a newly provisioned machine running AIX 6.1. The gcc-4.3.5
> that is available via rpm uses the aix thread model and I need to
> build with pthreads.  I have built pre-req's bintuils-2.22,
> mpfr-3.1.1-1, gmp-5.0.5.
>
> I am currently trying to bootstrap using gcc-4.3.5-1. I have tried the
> native compiler, xlc, but had other errors and am back to using gcc.
> (Not to mention that the documentation told me that using gcc was an
> better path to follow.)
>
> Question #1) --enable-threads=posix does not seem to work. Is this
> flag supported or perhaps I am using it incorrectly?
>
> Here is my configure statement:
>
> /opt/gcc_work/gcc-4.3.5-src/
> configure --disable-shared --enable-static --enable-threads=posix
> --prefix=/opt/freeware/gcc_4_3_5 --exec-prefix=/opt/freeware/gcc_4_3_5
> -enable-languages=c,c++ --srcdir=/opt/gcc_work/gcc-4.3.5-src
> --includedir=/opt/gcc_work/gcc-4.3.5-src/include "CFLAGS=-pthread"
> "CXXFLAGS=-pthread"
>
> In <build dir>/config.log I see:
>
> "
> Configured with: ../gcc-4.3.5/configure --with-as=/usr/bin/as
> --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=
> /opt/freeware --enable-threads --enable-version-specific-runtime-libs
> --disable-nls --enable-decimal-float=dpd --host=powerpc-
> ibm-aix6.1.0.0
> Thread model: aix
> "
>
> The thread model might have been an omen that leads to my second question.
>
> Question #2) How can I propagate the use of pthreads into the build?
>
> The build is currently dying in the intl directory. Here is the
> trouble area from <build dir>/intl/config.log:
>
> "
> configure:2092:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/ -B/opt/freeware/g
> cc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -V </dev/null >&5
> xgcc: '-V' must come at the start of the command line
> configure:2095: $? = 1
> configure:2118: checking for C compiler default output file name
> configure:2121:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
> -B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
> -Wl,-bbigtoc conftest.c  >&5
> ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_wait
> ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_broadcast
> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_init
> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_settype
> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_destroy
> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_trylock
> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
> ld: 0711-317 ERROR: Undefined symbol: .pthread_setspecific
> ld: 0711-317 ERROR: Undefined symbol: .pthread_getspecific
> ld: 0711-317 ERROR: Undefined symbol: .pthread_key_delete
> ld: 0711-317 ERROR: Undefined symbol: .pthread_key_create
> ld: 0711-317 ERROR: Undefined symbol: .pthread_once
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> collect2: ld returned 8 exit status
> configure:2124: $? = 1
> "
>
> If I add "-lpthread" to the command that configure ran and run it
> myself, it works:
>
> "
> bash-3.2# /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
> -B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
> -Wl,-bbigtoc -lpthread /tmp/conftest.c
> bash-3.2# echo $?
> 0
> "
>
> Thanks,
>  -Rick

No takers???

I tried using 4.3.5 to bootstrap gcc 4.7.2 and had new problems. (And,
4.7.2 is not the version that I really need.) I tried invoking xlc in
a number of ways to bootstrao, c99_r7, xlc_r7, etc. Each invocation
fails differently. I might as well keep trying to solve the original
problem.

So, how do I get pthread support in gcc 4.3.5? If it is a simple
configuration item that I missed, I'll take the well-deserved flames
along with a pointer in the right direction.

Thanks in advance,
 -Rick

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

* Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
  2012-10-26 15:21 ` Rick Springob
@ 2012-10-26 21:44   ` Jonathan Wakely
  2012-10-26 22:09     ` David Edelsohn
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Wakely @ 2012-10-26 21:44 UTC (permalink / raw)
  To: Rick Springob; +Cc: gcc-help, David Edelsohn

David, any ideas about this one?

On 26 October 2012 14:01, Rick Springob <rspringob@gmail.com> wrote:
> On Thu, Oct 18, 2012 at 4:08 PM, Rick Springob <rspringob@gmail.com> wrote:
>> I need to use an older version of gcc in order to help debug an old,
>> released build. We will also run new builds with gcc-4.3.5  for
>> compatibility reasons.  The original build machine is toast. I am
>> working in a newly provisioned machine running AIX 6.1. The gcc-4.3.5
>> that is available via rpm uses the aix thread model and I need to
>> build with pthreads.  I have built pre-req's bintuils-2.22,
>> mpfr-3.1.1-1, gmp-5.0.5.
>>
>> I am currently trying to bootstrap using gcc-4.3.5-1. I have tried the
>> native compiler, xlc, but had other errors and am back to using gcc.
>> (Not to mention that the documentation told me that using gcc was an
>> better path to follow.)
>>
>> Question #1) --enable-threads=posix does not seem to work. Is this
>> flag supported or perhaps I am using it incorrectly?
>>
>> Here is my configure statement:
>>
>> /opt/gcc_work/gcc-4.3.5-src/
>> configure --disable-shared --enable-static --enable-threads=posix
>> --prefix=/opt/freeware/gcc_4_3_5 --exec-prefix=/opt/freeware/gcc_4_3_5
>> -enable-languages=c,c++ --srcdir=/opt/gcc_work/gcc-4.3.5-src
>> --includedir=/opt/gcc_work/gcc-4.3.5-src/include "CFLAGS=-pthread"
>> "CXXFLAGS=-pthread"
>>
>> In <build dir>/config.log I see:
>>
>> "
>> Configured with: ../gcc-4.3.5/configure --with-as=/usr/bin/as
>> --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=
>> /opt/freeware --enable-threads --enable-version-specific-runtime-libs
>> --disable-nls --enable-decimal-float=dpd --host=powerpc-
>> ibm-aix6.1.0.0
>> Thread model: aix
>> "
>>
>> The thread model might have been an omen that leads to my second question.
>>
>> Question #2) How can I propagate the use of pthreads into the build?
>>
>> The build is currently dying in the intl directory. Here is the
>> trouble area from <build dir>/intl/config.log:
>>
>> "
>> configure:2092:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
>> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/ -B/opt/freeware/g
>> cc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -V </dev/null >&5
>> xgcc: '-V' must come at the start of the command line
>> configure:2095: $? = 1
>> configure:2118: checking for C compiler default output file name
>> configure:2121:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
>> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
>> -B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
>> -Wl,-bbigtoc conftest.c  >&5
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_wait
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_broadcast
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_init
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_settype
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_destroy
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_trylock
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_setspecific
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_getspecific
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_key_delete
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_key_create
>> ld: 0711-317 ERROR: Undefined symbol: .pthread_once
>> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
>> collect2: ld returned 8 exit status
>> configure:2124: $? = 1
>> "
>>
>> If I add "-lpthread" to the command that configure ran and run it
>> myself, it works:
>>
>> "
>> bash-3.2# /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
>> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
>> -B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
>> -Wl,-bbigtoc -lpthread /tmp/conftest.c
>> bash-3.2# echo $?
>> 0
>> "
>>
>> Thanks,
>>  -Rick
>
> No takers???
>
> I tried using 4.3.5 to bootstrap gcc 4.7.2 and had new problems. (And,
> 4.7.2 is not the version that I really need.) I tried invoking xlc in
> a number of ways to bootstrao, c99_r7, xlc_r7, etc. Each invocation
> fails differently. I might as well keep trying to solve the original
> problem.
>
> So, how do I get pthread support in gcc 4.3.5? If it is a simple
> configuration item that I missed, I'll take the well-deserved flames
> along with a pointer in the right direction.
>
> Thanks in advance,
>  -Rick

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

* Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
  2012-10-26 21:44   ` Jonathan Wakely
@ 2012-10-26 22:09     ` David Edelsohn
  2012-10-26 22:26       ` Rick Springob
  0 siblings, 1 reply; 10+ messages in thread
From: David Edelsohn @ 2012-10-26 22:09 UTC (permalink / raw)
  To: Jonathan Wakely, Rick Springob; +Cc: gcc-help

I am completely confused what Rick is trying to do.

First, do not use GNU Binutils on AIX. I do not understand the
reference to Binutils 2.22.  Remove GNU as and GNU ld from your path.

GCC builds correctly on AIX without all of the extra options.  do not
enable threads, do not specify threads=posix do not disable shared, do
not enable static, do not add -pthread to CFLAGS.

If you stop trying to override everything, GCC will build without problem.

- David

On Fri, Oct 26, 2012 at 10:34 AM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> David, any ideas about this one?
>
> On 26 October 2012 14:01, Rick Springob <rspringob@gmail.com> wrote:
>> On Thu, Oct 18, 2012 at 4:08 PM, Rick Springob <rspringob@gmail.com> wrote:
>>> I need to use an older version of gcc in order to help debug an old,
>>> released build. We will also run new builds with gcc-4.3.5  for
>>> compatibility reasons.  The original build machine is toast. I am
>>> working in a newly provisioned machine running AIX 6.1. The gcc-4.3.5
>>> that is available via rpm uses the aix thread model and I need to
>>> build with pthreads.  I have built pre-req's bintuils-2.22,
>>> mpfr-3.1.1-1, gmp-5.0.5.
>>>
>>> I am currently trying to bootstrap using gcc-4.3.5-1. I have tried the
>>> native compiler, xlc, but had other errors and am back to using gcc.
>>> (Not to mention that the documentation told me that using gcc was an
>>> better path to follow.)
>>>
>>> Question #1) --enable-threads=posix does not seem to work. Is this
>>> flag supported or perhaps I am using it incorrectly?
>>>
>>> Here is my configure statement:
>>>
>>> /opt/gcc_work/gcc-4.3.5-src/
>>> configure --disable-shared --enable-static --enable-threads=posix
>>> --prefix=/opt/freeware/gcc_4_3_5 --exec-prefix=/opt/freeware/gcc_4_3_5
>>> -enable-languages=c,c++ --srcdir=/opt/gcc_work/gcc-4.3.5-src
>>> --includedir=/opt/gcc_work/gcc-4.3.5-src/include "CFLAGS=-pthread"
>>> "CXXFLAGS=-pthread"
>>>
>>> In <build dir>/config.log I see:
>>>
>>> "
>>> Configured with: ../gcc-4.3.5/configure --with-as=/usr/bin/as
>>> --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=
>>> /opt/freeware --enable-threads --enable-version-specific-runtime-libs
>>> --disable-nls --enable-decimal-float=dpd --host=powerpc-
>>> ibm-aix6.1.0.0
>>> Thread model: aix
>>> "
>>>
>>> The thread model might have been an omen that leads to my second question.
>>>
>>> Question #2) How can I propagate the use of pthreads into the build?
>>>
>>> The build is currently dying in the intl directory. Here is the
>>> trouble area from <build dir>/intl/config.log:
>>>
>>> "
>>> configure:2092:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
>>> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/ -B/opt/freeware/g
>>> cc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -V </dev/null >&5
>>> xgcc: '-V' must come at the start of the command line
>>> configure:2095: $? = 1
>>> configure:2118: checking for C compiler default output file name
>>> configure:2121:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
>>> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
>>> -B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
>>> -Wl,-bbigtoc conftest.c  >&5
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_wait
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_broadcast
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_init
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_settype
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_destroy
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_trylock
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_setspecific
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_getspecific
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_key_delete
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_key_create
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_once
>>> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
>>> collect2: ld returned 8 exit status
>>> configure:2124: $? = 1
>>> "
>>>
>>> If I add "-lpthread" to the command that configure ran and run it
>>> myself, it works:
>>>
>>> "
>>> bash-3.2# /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
>>> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
>>> -B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
>>> -Wl,-bbigtoc -lpthread /tmp/conftest.c
>>> bash-3.2# echo $?
>>> 0
>>> "
>>>
>>> Thanks,
>>>  -Rick
>>
>> No takers???
>>
>> I tried using 4.3.5 to bootstrap gcc 4.7.2 and had new problems. (And,
>> 4.7.2 is not the version that I really need.) I tried invoking xlc in
>> a number of ways to bootstrao, c99_r7, xlc_r7, etc. Each invocation
>> fails differently. I might as well keep trying to solve the original
>> problem.
>>
>> So, how do I get pthread support in gcc 4.3.5? If it is a simple
>> configuration item that I missed, I'll take the well-deserved flames
>> along with a pointer in the right direction.
>>
>> Thanks in advance,
>>  -Rick

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

* Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
  2012-10-26 22:09     ` David Edelsohn
@ 2012-10-26 22:26       ` Rick Springob
  2012-10-26 23:28         ` David Edelsohn
  0 siblings, 1 reply; 10+ messages in thread
From: Rick Springob @ 2012-10-26 22:26 UTC (permalink / raw)
  To: gcc-help; +Cc: Jonathan Wakely, David Edelsohn

On Fri, Oct 26, 2012 at 11:20 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> I am completely confused what Rick is trying to do.
>
> First, do not use GNU Binutils on AIX. I do not understand the
> reference to Binutils 2.22.  Remove GNU as and GNU ld from your path.

I do not understand the relationship to binutils to gcc either. The
build instructions for gcc list binutils as a pre-requisite. Elsewhere
in the build instructions, you are told to use the native linker and
other tools rather than the binutil versions.  In the configure
script, there is an option for specifying binutils. Why is it there a
configuration option if it should not be used? In any case, binutils
are not in my path. Thus, configure does not use them. I do not think
that this is contributing to the current problem.

> GCC builds correctly on AIX without all of the extra options.  do not
> enable threads, do not specify threads=posix do not disable shared, do
> not enable static, do not add -pthread to CFLAGS.

Regarding static, I am looking to build a compiler that can be used in
a common toolchain shared among build hosts. This ensures that the
compiler will behave consistently on various hosts rather than being
subject to the variability of the shared objects on each system. When
a machine hangs around for years, for example, expanding the build
farm with an exact replica of hardware and software becomes
increasingly difficult as time marches on.

For the threading option, we have a bug that appeared when we started
using a new version of the gcc compiler. We were forced to move to a
new compiler when we found that we could not replace the ancient
hardware.The new hardware did not support the old O/S. The new version
of AIX did not support the old gcc compiler. We installed 4.3.5 via
RPM.

The current suspect of the bug is the aix threading model. The same
code executes fine on 6 other flavors of unix that are built with gcc
using posix threads. Even if the bug turns out not to be due to the
threading model, eliminating the suspect or seeing a different symptom
may help to figure it out.

>
> If you stop trying to override everything, GCC will build without problem.
>
> - David
>

I wish we could simplify. But, circumstances are preventing us from
taking the easy path.

So, pthreads are not supported on AIX? Or, is there some way to
convince 'configure' how to use pthreads without using a CFLAGS? The
enable-threads=posix option seems to be the right way to do it but it
is obviously not working.

-Rick

> On Fri, Oct 26, 2012 at 10:34 AM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>> David, any ideas about this one?
>>
>> On 26 October 2012 14:01, Rick Springob <rspringob@gmail.com> wrote:
>>> On Thu, Oct 18, 2012 at 4:08 PM, Rick Springob <rspringob@gmail.com> wrote:
>>>> I need to use an older version of gcc in order to help debug an old,
>>>> released build. We will also run new builds with gcc-4.3.5  for
>>>> compatibility reasons.  The original build machine is toast. I am
>>>> working in a newly provisioned machine running AIX 6.1. The gcc-4.3.5
>>>> that is available via rpm uses the aix thread model and I need to
>>>> build with pthreads.  I have built pre-req's bintuils-2.22,
>>>> mpfr-3.1.1-1, gmp-5.0.5.
>>>>
>>>> I am currently trying to bootstrap using gcc-4.3.5-1. I have tried the
>>>> native compiler, xlc, but had other errors and am back to using gcc.
>>>> (Not to mention that the documentation told me that using gcc was an
>>>> better path to follow.)
>>>>
>>>> Question #1) --enable-threads=posix does not seem to work. Is this
>>>> flag supported or perhaps I am using it incorrectly?
>>>>
>>>> Here is my configure statement:
>>>>
>>>> /opt/gcc_work/gcc-4.3.5-src/
>>>> configure --disable-shared --enable-static --enable-threads=posix
>>>> --prefix=/opt/freeware/gcc_4_3_5 --exec-prefix=/opt/freeware/gcc_4_3_5
>>>> -enable-languages=c,c++ --srcdir=/opt/gcc_work/gcc-4.3.5-src
>>>> --includedir=/opt/gcc_work/gcc-4.3.5-src/include "CFLAGS=-pthread"
>>>> "CXXFLAGS=-pthread"
>>>>
>>>> In <build dir>/config.log I see:
>>>>
>>>> "
>>>> Configured with: ../gcc-4.3.5/configure --with-as=/usr/bin/as
>>>> --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=
>>>> /opt/freeware --enable-threads --enable-version-specific-runtime-libs
>>>> --disable-nls --enable-decimal-float=dpd --host=powerpc-
>>>> ibm-aix6.1.0.0
>>>> Thread model: aix
>>>> "
>>>>
>>>> The thread model might have been an omen that leads to my second question.
>>>>
>>>> Question #2) How can I propagate the use of pthreads into the build?
>>>>
>>>> The build is currently dying in the intl directory. Here is the
>>>> trouble area from <build dir>/intl/config.log:
>>>>
>>>> "
>>>> configure:2092:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
>>>> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/ -B/opt/freeware/g
>>>> cc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -V </dev/null >&5
>>>> xgcc: '-V' must come at the start of the command line
>>>> configure:2095: $? = 1
>>>> configure:2118: checking for C compiler default output file name
>>>> configure:2121:  /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
>>>> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
>>>> -B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
>>>> -Wl,-bbigtoc conftest.c  >&5
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_wait
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_cond_broadcast
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_init
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_settype
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutexattr_destroy
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_trylock
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_setspecific
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_getspecific
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_key_delete
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_key_create
>>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_once
>>>> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
>>>> collect2: ld returned 8 exit status
>>>> configure:2124: $? = 1
>>>> "
>>>>
>>>> If I add "-lpthread" to the command that configure ran and run it
>>>> myself, it works:
>>>>
>>>> "
>>>> bash-3.2# /data/gcc_work/gcc-4.3.5-build/./prev-gcc/xgcc
>>>> -B/data/gcc_work/gcc-4.3.5-build/./prev-gcc/
>>>> -B/opt/freeware/gcc_4_3_5/powerpc-ibm-aix6.1.0.0/bin/ -g -O2
>>>> -Wl,-bbigtoc -lpthread /tmp/conftest.c
>>>> bash-3.2# echo $?
>>>> 0
>>>> "
>>>>
>>>> Thanks,
>>>>  -Rick
>>>
>>> No takers???
>>>
>>> I tried using 4.3.5 to bootstrap gcc 4.7.2 and had new problems. (And,
>>> 4.7.2 is not the version that I really need.) I tried invoking xlc in
>>> a number of ways to bootstrao, c99_r7, xlc_r7, etc. Each invocation
>>> fails differently. I might as well keep trying to solve the original
>>> problem.
>>>
>>> So, how do I get pthread support in gcc 4.3.5? If it is a simple
>>> configuration item that I missed, I'll take the well-deserved flames
>>> along with a pointer in the right direction.
>>>
>>> Thanks in advance,
>>>  -Rick

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

* Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
  2012-10-26 22:26       ` Rick Springob
@ 2012-10-26 23:28         ` David Edelsohn
  2012-10-27 15:27           ` Jędrzej Dudkiewicz
  2012-10-30  8:36           ` Rick Springob
  0 siblings, 2 replies; 10+ messages in thread
From: David Edelsohn @ 2012-10-26 23:28 UTC (permalink / raw)
  To: Rick Springob; +Cc: gcc-help, Jonathan Wakely

On Fri, Oct 26, 2012 at 2:12 PM, Rick Springob <rspringob@gmail.com> wrote:

> I do not understand the relationship to binutils to gcc either. The
> build instructions for gcc list binutils as a pre-requisite. Elsewhere
> in the build instructions, you are told to use the native linker and
> other tools rather than the binutil versions.  In the configure
> script, there is an option for specifying binutils. Why is it there a
> configuration option if it should not be used? In any case, binutils
> are not in my path. Thus, configure does not use them. I do not think
> that this is contributing to the current problem.

Binutils does not work correctly on AIX 5, AIX 6 or AIX 7.  Do not use
it.  Do not set extra options about which as and ld to use.  Simply
ensure that /opt/freeware/bin/as and .../ld are not in your patch.

> Regarding static, I am looking to build a compiler that can be used in
> a common toolchain shared among build hosts. This ensures that the
> compiler will behave consistently on various hosts rather than being
> subject to the variability of the shared objects on each system. When
> a machine hangs around for years, for example, expanding the build
> farm with an exact replica of hardware and software becomes
> increasingly difficult as time marches on.

C++ and Exception handling will not work correctly with static
libraries on AIX.  One also will encounter missing symbols that are
provided by libsupc++.

> For the threading option, we have a bug that appeared when we started
> using a new version of the gcc compiler. We were forced to move to a
> new compiler when we found that we could not replace the ancient
> hardware.The new hardware did not support the old O/S. The new version
> of AIX did not support the old gcc compiler. We installed 4.3.5 via
> RPM.

If you want to use pre-built GCC, I strongly recommend using the ones
from http://www.perzl.org/aix/ and NOT the AIX Toolbox for Linux.

> The current suspect of the bug is the aix threading model. The same
> code executes fine on 6 other flavors of unix that are built with gcc
> using posix threads. Even if the bug turns out not to be due to the
> threading model, eliminating the suspect or seeing a different symptom
> may help to figure it out.

> I wish we could simplify. But, circumstances are preventing us from
> taking the easy path.
>
> So, pthreads are not supported on AIX? Or, is there some way to
> convince 'configure' how to use pthreads without using a CFLAGS? The
> enable-threads=posix option seems to be the right way to do it but it
> is obviously not working.

Pthreads are supported on AIX. Again, STOP adding it to the GCC
configure command line.  Do not mention --enabled-threads on the GCC
configure command line.  Do not write posix on the GCC configure
command line.  How many ways to I need to write this?

GCC builds on AIX with pthreads support by default.  One simply
invokes GCC with "-pthread" at compile time.  The support is there.
Just stop trying to explicitly enable it when you configure GCC.
Because of some AIX complexity, the thread support is slightly more
complicated and enabling "posix" is wrong.  Your extra options are
causing you all of your problems building GCC.

- David

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

* Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
  2012-10-26 23:28         ` David Edelsohn
@ 2012-10-27 15:27           ` Jędrzej Dudkiewicz
  2012-10-27 19:05             ` David Edelsohn
  2012-10-30  8:36           ` Rick Springob
  1 sibling, 1 reply; 10+ messages in thread
From: Jędrzej Dudkiewicz @ 2012-10-27 15:27 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Rick Springob, gcc-help, Jonathan Wakely

On Fri, Oct 26, 2012 at 11:44 PM, David Edelsohn <dje.gcc@gmail.com> wrote:
> On Fri, Oct 26, 2012 at 2:12 PM, Rick Springob <rspringob@gmail.com> wrote:
>
>> I do not understand the relationship to binutils to gcc either. The
>> build instructions for gcc list binutils as a pre-requisite. Elsewhere
>> in the build instructions, you are told to use the native linker and
>> other tools rather than the binutil versions.  In the configure
>> script, there is an option for specifying binutils. Why is it there a
>> configuration option if it should not be used? In any case, binutils
>> are not in my path. Thus, configure does not use them. I do not think
>> that this is contributing to the current problem.
>
> Binutils does not work correctly on AIX 5, AIX 6 or AIX 7.  Do not use
> it.  Do not set extra options about which as and ld to use.  Simply
> ensure that /opt/freeware/bin/as and .../ld are not in your patch.

Does it mean that there is no way whatsoever to build cross-compiler
for AIX? No Linux->AIX, Solaris->AIX, nothing?

>> Regarding static, I am looking to build a compiler that can be used in
>> a common toolchain shared among build hosts. This ensures that the
>> compiler will behave consistently on various hosts rather than being
>> subject to the variability of the shared objects on each system. When
>> a machine hangs around for years, for example, expanding the build
>> farm with an exact replica of hardware and software becomes
>> increasingly difficult as time marches on.
>
> C++ and Exception handling will not work correctly with static
> libraries on AIX.  One also will encounter missing symbols that are
> provided by libsupc++.

Does it mean that my binaries with static libgcc and libstdc++ (custom
gcc build, so "static" library does not contain .so) work purely by
chance? Or are you writing about newest gcc versions?
-- 
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.

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

* Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
  2012-10-27 15:27           ` Jędrzej Dudkiewicz
@ 2012-10-27 19:05             ` David Edelsohn
  2012-10-28 15:38               ` Jędrzej Dudkiewicz
  0 siblings, 1 reply; 10+ messages in thread
From: David Edelsohn @ 2012-10-27 19:05 UTC (permalink / raw)
  To: Jędrzej Dudkiewicz; +Cc: Rick Springob, gcc-help, Jonathan Wakely

On Sat, Oct 27, 2012 at 4:17 AM, Jędrzej Dudkiewicz
<jedrzej.dudkiewicz@gmail.com> wrote:

>> Binutils does not work correctly on AIX 5, AIX 6 or AIX 7.  Do not use
>> it.  Do not set extra options about which as and ld to use.  Simply
>> ensure that /opt/freeware/bin/as and .../ld are not in your patch.
>
> Does it mean that there is no way whatsoever to build cross-compiler
> for AIX? No Linux->AIX, Solaris->AIX, nothing?

Binutils works for AIX 4.3.3 and possibly AIX 5.1.  Unfortunately, it
has not been updated and creates incorrect object files when used on
later releases of AIX.

My advice is tell IBM sales people that this feature and functionality
is necessary.  IBM responds to customers and ISVs.  If they tell IBM
GNU Binutils and cross-compilation is important for business, IBM will
take action.

> Does it mean that my binaries with static libgcc and libstdc++ (custom
> gcc build, so "static" library does not contain .so) work purely by
> chance? Or are you writing about newest gcc versions?

It depends what C++ features you use and how the libraries are built.
Building completely static archive libraries may work.  The other
approach is build normal (shared) libraries but statically link them.
The problem is throwing exceptions across library boundaries because
one can end up with separate copies of the EH data structures.

Newer versions of GCC should automatically link with libsupc++ for
static linking to resolve at least that part of the problem.

- David

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

* Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
  2012-10-27 19:05             ` David Edelsohn
@ 2012-10-28 15:38               ` Jędrzej Dudkiewicz
  0 siblings, 0 replies; 10+ messages in thread
From: Jędrzej Dudkiewicz @ 2012-10-28 15:38 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Rick Springob, gcc-help, Jonathan Wakely

On Sat, Oct 27, 2012 at 5:27 PM, David Edelsohn <dje.gcc@gmail.com> wrote:
> On Sat, Oct 27, 2012 at 4:17 AM, Jędrzej Dudkiewicz
> <jedrzej.dudkiewicz@gmail.com> wrote:
>
>>> Binutils does not work correctly on AIX 5, AIX 6 or AIX 7.  Do not use
>>> it.  Do not set extra options about which as and ld to use.  Simply
>>> ensure that /opt/freeware/bin/as and .../ld are not in your patch.
>>
>> Does it mean that there is no way whatsoever to build cross-compiler
>> for AIX? No Linux->AIX, Solaris->AIX, nothing?
>
> Binutils works for AIX 4.3.3 and possibly AIX 5.1.  Unfortunately, it
> has not been updated and creates incorrect object files when used on
> later releases of AIX.

Great news! I were able to build Solaris -> AIX 4.3.3 crosscompiler,
but only C works, I were unable to make C++ work and, unfortunately,
never got any response when I asked here, so I assumed that such build
wasn't even considered work. But I'll try again, just let me find my
old post(s).

> My advice is tell IBM sales people that this feature and functionality
> is necessary.  IBM responds to customers and ISVs.  If they tell IBM
> GNU Binutils and cross-compilation is important for business, IBM will
> take action.

Unfortunately I'm in no position to make such requests and formalities
required for doing so will take forever, so I'd rather try different
approach (namely - asking here).

>> Does it mean that my binaries with static libgcc and libstdc++ (custom
>> gcc build, so "static" library does not contain .so) work purely by
>> chance? Or are you writing about newest gcc versions?
>
> It depends what C++ features you use and how the libraries are built.
> Building completely static archive libraries may work.  The other
> approach is build normal (shared) libraries but statically link them.
> The problem is throwing exceptions across library boundaries because
> one can end up with separate copies of the EH data structures.
>
> Newer versions of GCC should automatically link with libsupc++ for
> static linking to resolve at least that part of the problem.

Ok, thanks. I think I understand what you mean, but I'll have to try
doing it in practice.
-- 
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.

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

* Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads
  2012-10-26 23:28         ` David Edelsohn
  2012-10-27 15:27           ` Jędrzej Dudkiewicz
@ 2012-10-30  8:36           ` Rick Springob
  1 sibling, 0 replies; 10+ messages in thread
From: Rick Springob @ 2012-10-30  8:36 UTC (permalink / raw)
  To: David Edelsohn; +Cc: gcc-help, Jonathan Wakely

Going to top-post to perhaps close this out.

Thank you, David! The information you provided is extremely helpful. I
was beginning to suspect that building the compiler with pthreads was
orthogonal to the problem. Your explanations helped clarify that issue
and to avoid other problems. Rolling it up for anyone that might find
this thread:

 --trying to inject pthreads into the bootstrap process is wrong
 --trying to use pthread in CFLAGS is wrong
 --gcc has pthread support for AIX without the need to be built itself
with pthreads
 --do not use binutils for AIX (the O/S specific docs trump the
general build instructions)
 --avoid statically linking as it can introduce exception handling
problems in C++.

Thanks again,
  -Rick

On Fri, Oct 26, 2012 at 5:44 PM, David Edelsohn <dje.gcc@gmail.com> wrote:
> On Fri, Oct 26, 2012 at 2:12 PM, Rick Springob <rspringob@gmail.com> wrote:
>
>> I do not understand the relationship to binutils to gcc either. The
>> build instructions for gcc list binutils as a pre-requisite. Elsewhere
>> in the build instructions, you are told to use the native linker and
>> other tools rather than the binutil versions.  In the configure
>> script, there is an option for specifying binutils. Why is it there a
>> configuration option if it should not be used? In any case, binutils
>> are not in my path. Thus, configure does not use them. I do not think
>> that this is contributing to the current problem.
>
> Binutils does not work correctly on AIX 5, AIX 6 or AIX 7.  Do not use
> it.  Do not set extra options about which as and ld to use.  Simply
> ensure that /opt/freeware/bin/as and .../ld are not in your patch.
>
>> Regarding static, I am looking to build a compiler that can be used in
>> a common toolchain shared among build hosts. This ensures that the
>> compiler will behave consistently on various hosts rather than being
>> subject to the variability of the shared objects on each system. When
>> a machine hangs around for years, for example, expanding the build
>> farm with an exact replica of hardware and software becomes
>> increasingly difficult as time marches on.
>
> C++ and Exception handling will not work correctly with static
> libraries on AIX.  One also will encounter missing symbols that are
> provided by libsupc++.
>
>> For the threading option, we have a bug that appeared when we started
>> using a new version of the gcc compiler. We were forced to move to a
>> new compiler when we found that we could not replace the ancient
>> hardware.The new hardware did not support the old O/S. The new version
>> of AIX did not support the old gcc compiler. We installed 4.3.5 via
>> RPM.
>
> If you want to use pre-built GCC, I strongly recommend using the ones
> from http://www.perzl.org/aix/ and NOT the AIX Toolbox for Linux.
>
>> The current suspect of the bug is the aix threading model. The same
>> code executes fine on 6 other flavors of unix that are built with gcc
>> using posix threads. Even if the bug turns out not to be due to the
>> threading model, eliminating the suspect or seeing a different symptom
>> may help to figure it out.
>
>> I wish we could simplify. But, circumstances are preventing us from
>> taking the easy path.
>>
>> So, pthreads are not supported on AIX? Or, is there some way to
>> convince 'configure' how to use pthreads without using a CFLAGS? The
>> enable-threads=posix option seems to be the right way to do it but it
>> is obviously not working.
>
> Pthreads are supported on AIX. Again, STOP adding it to the GCC
> configure command line.  Do not mention --enabled-threads on the GCC
> configure command line.  Do not write posix on the GCC configure
> command line.  How many ways to I need to write this?
>
> GCC builds on AIX with pthreads support by default.  One simply
> invokes GCC with "-pthread" at compile time.  The support is there.
> Just stop trying to explicitly enable it when you configure GCC.
> Because of some AIX complexity, the thread support is slightly more
> complicated and enabling "posix" is wrong.  Your extra options are
> causing you all of your problems building GCC.
>
> - David

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

end of thread, other threads:[~2012-10-29 12:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-19  1:44 problems building gcc-4.3.5-1 on AIX 6.1 with pthreads Rick Springob
2012-10-26 15:21 ` Rick Springob
2012-10-26 21:44   ` Jonathan Wakely
2012-10-26 22:09     ` David Edelsohn
2012-10-26 22:26       ` Rick Springob
2012-10-26 23:28         ` David Edelsohn
2012-10-27 15:27           ` Jędrzej Dudkiewicz
2012-10-27 19:05             ` David Edelsohn
2012-10-28 15:38               ` Jędrzej Dudkiewicz
2012-10-30  8:36           ` Rick Springob

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).