Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads

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

 



On Fri, Oct 26, 2012 at 11:20 AM, David Edelsohn <dje.gcc@xxxxxxxxx> 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@xxxxxxxxx> wrote:
>> David, any ideas about this one?
>>
>> On 26 October 2012 14:01, Rick Springob <rspringob@xxxxxxxxx> wrote:
>>> On Thu, Oct 18, 2012 at 4:08 PM, Rick Springob <rspringob@xxxxxxxxx> 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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux