From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26006 invoked by alias); 29 Oct 2012 12:14:37 -0000 Received: (qmail 25996 invoked by uid 22791); 29 Oct 2012 12:14:33 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SARE_SPEC_REPLICA_OBFU X-Spam-Check-By: sourceware.org Received: from mail-ee0-f47.google.com (HELO mail-ee0-f47.google.com) (74.125.83.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Oct 2012 12:14:24 +0000 Received: by mail-ee0-f47.google.com with SMTP id t10so2335327eei.20 for ; Mon, 29 Oct 2012 05:14:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.14.221.8 with SMTP id q8mr60483686eep.28.1351512861915; Mon, 29 Oct 2012 05:14:21 -0700 (PDT) Received: by 10.223.96.69 with HTTP; Mon, 29 Oct 2012 05:14:21 -0700 (PDT) In-Reply-To: References: Date: Tue, 30 Oct 2012 08:36:00 -0000 Message-ID: Subject: Re: problems building gcc-4.3.5-1 on AIX 6.1 with pthreads From: Rick Springob To: David Edelsohn Cc: gcc-help@gcc.gnu.org, Jonathan Wakely Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg00168.txt.bz2 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 wrote: > On Fri, Oct 26, 2012 at 2:12 PM, Rick Springob 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