Bug 26794 - Checking for gthread causes configure script to fail
Summary: Checking for gthread causes configure script to fail
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: libobjc (show other bugs)
Version: 3.4.6
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-22 06:05 UTC by Issac Trotts
Modified: 2006-03-22 06:55 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
config.log (927 bytes, application/octet-stream)
2006-03-22 06:24 UTC, Issac Trotts
Details
Makefile (39.77 KB, application/octet-stream)
2006-03-22 06:37 UTC, Issac Trotts
Details
configure.in (1.82 KB, application/octet-stream)
2006-03-22 06:37 UTC, Issac Trotts
Details
configure (23.28 KB, text/plain)
2006-03-22 06:37 UTC, Issac Trotts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Issac Trotts 2006-03-22 06:05:31 UTC
Here are a couple of patches to make gcc-3.4.6/libobjc compile on my system: Gentoo on an AMD box with gcc-3.3.5.  The problem was that the configure script was failing with this error:

checking for gthread cflags... configure: error: not found

because there is nothing to be found about GTHREAD in ../Makefile, contrary to what is said in the file THREADS:

<quote>
If you are compiling libobjc as part of GCC, the thr-objc.c backend is
always used; this backend uses GCC's gthread code.  The thread system
is automatically configured when GCC is configured.  Important: make
sure you configure GCC using `--enable-threads' if you want threads !
</quote>

I configured gcc-3.4.6 with --enable-threads so I guess this documentation is outdated.



$ diff -Naur configure.in{.old,}
--- configure.in.old    2006-03-21 21:38:41.000000000 -0800
+++ configure.in        2006-03-21 21:38:00.000000000 -0800
@@ -75,16 +75,16 @@

 # Determine CFLAGS for gthread.

-AC_CACHE_CHECK([for gthread cflags],objc_cv_gthread_flags,
-[if test -f "$r"/gcc/Makefile
-then
-  objc_cv_gthread_flags=`grep \^GTHREAD_FLAGS "$r"/gcc/Makefile | awk -F= '{ print $2 }'`
-else
-  AC_MSG_ERROR([not found])
-fi])
-GTHREAD_FLAGS=$objc_cv_gthread_flags
-AC_SUBST(GTHREAD_FLAGS)
-
+dnl AC_CACHE_CHECK([for gthread cflags],objc_cv_gthread_flags,
+dnl [if test -f "$r"/gcc/Makefile
+dnl then
+dnl   objc_cv_gthread_flags=`grep \^GTHREAD_FLAGS "$r"/gcc/Makefile | awk -F= '{ print $2 }'`
+dnl else
+dnl   AC_MSG_ERROR([not found])
+dnl fi])
+dnl GTHREAD_FLAGS=$objc_cv_gthread_flags
+dnl AC_SUBST(GTHREAD_FLAGS)
+
 AC_ARG_ENABLE(objc-gc,
 [  --enable-objc-gc       enable the use of Boehm's garbage collector with
                           the GNU Objective-C runtime.],




$ diff -Naur Makefile.in{.old,}
--- Makefile.in.old     2006-03-21 21:47:16.000000000 -0800
+++ Makefile.in 2006-03-21 21:47:19.000000000 -0800
@@ -69,7 +69,7 @@
 CC = @CC@
 CFLAGS = @CFLAGS@
 WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
-GTHREAD_FLAGS=@GTHREAD_FLAGS@
+#GTHREAD_FLAGS=@GTHREAD_FLAGS@
 ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
        $(GTHREAD_FLAGS) -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing

Now it configures and compiles just fine.
Comment 1 Andrew Pinski 2006-03-22 06:08:38 UTC
Can you attach the config.log from the libobjc subdirectory as this failure does not make sense?

-- Pinski
a libobjc maintainer
Comment 2 Andrew Pinski 2006-03-22 06:11:06 UTC
Also how did you configure GCC?
Comment 3 Andrew Pinski 2006-03-22 06:11:57 UTC
And GTHREAD is defined in gcc/Makefile:
GTHREAD_FLAGS=@gthread_flags@
Comment 4 Andrew Pinski 2006-03-22 06:13:50 UTC
And the readme is still correct in that thr-objc.c is still used.
Comment 5 Issac Trotts 2006-03-22 06:24:56 UTC
Subject: Re:  Checking for gthread causes configure script to fail

Here it is.  Does it help?

On 22 Mar 2006 06:08:38 -0000, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-22 06:08 -------
> Can you attach the config.log from the libobjc subdirectory as this failure
> does not make sense?
>
> -- Pinski
> a libobjc maintainer
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26794
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
Comment 6 Issac Trotts 2006-03-22 06:24:56 UTC
Created attachment 11086 [details]
config.log
Comment 7 Andrew Pinski 2006-03-22 06:26:54 UTC
I should note this works for everyone else.  Is this a modified version of GCC that you are compiling?
Can you attach Makefile from the gcc subdirectory?
Comment 8 Issac Trotts 2006-03-22 06:27:12 UTC
Subject: Re:  Checking for gthread causes configure script to fail

Sure, but it doesn't tell you what to do if the configure script fails
saying that it can't find gthread.

On 22 Mar 2006 06:13:50 -0000, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #4 from pinskia at gcc dot gnu dot org  2006-03-22 06:13 -------
> And the readme is still correct in that thr-objc.c is still used.
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26794
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
Comment 9 Andrew Pinski 2006-03-22 06:29:57 UTC
Subject: Re:  Checking for gthread causes configure script to fail


On Mar 22, 2006, at 1:27 AM, issac dot trotts at gmail dot com wrote:
>
> Sure, but it doesn't tell you what to do if the configure script fails
> saying that it can't find gthread.

If it does not find gthread something else is way wrong.

-- Pinski
Comment 10 Issac Trotts 2006-03-22 06:33:02 UTC
Subject: Re:  Checking for gthread causes configure script to fail

OK, you're right.  I guess the $r variable (used in the path 
"$r"/gcc/Makefile) is not being set correctly in the libobjc configure
script.  Is this a bug or did I do something wrong?

On 22 Mar 2006 06:11:57 -0000, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #3 from pinskia at gcc dot gnu dot org  2006-03-22 06:11 -------
> And GTHREAD is defined in gcc/Makefile:
> GTHREAD_FLAGS=@gthread_flags@
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26794
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
Comment 11 Issac Trotts 2006-03-22 06:37:37 UTC
Subject: Re:  Checking for gthread causes configure script to fail

Sure, here it is.  I'm also attaching libobjc/configure{,.in}.


On 22 Mar 2006 06:26:54 -0000, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #7 from pinskia at gcc dot gnu dot org  2006-03-22 06:26 -------
> I should note this works for everyone else.  Is this a modified version of GCC
> that you are compiling?
> Can you attach Makefile from the gcc subdirectory?
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26794
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
Comment 12 Issac Trotts 2006-03-22 06:37:37 UTC
Created attachment 11087 [details]
Makefile
Comment 13 Issac Trotts 2006-03-22 06:37:37 UTC
Created attachment 11088 [details]
configure.in
Comment 14 Issac Trotts 2006-03-22 06:37:37 UTC
Created attachment 11089 [details]
configure
Comment 15 Andrew Pinski 2006-03-22 06:42:27 UTC
$r is setup by the toplevel Makefile:
configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out
        @test ! -f $(TARGET_SUBDIR)/libobjc/Makefile || exit 0; \
        $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(SET_LIB_PATH) \
        AR="$(AR_FOR_TARGET)"; export AR; \
        AS="$(AS_FOR_TARGET)"; export AS; \
        CC="$(CC_FOR_TARGET)"; export CC; \
        CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
        CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
        CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
        CXX="$(CXX_FOR_TARGET)"; export CXX; \
        CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
        GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
        DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
        LD="$(LD_FOR_TARGET)"; export LD; \
        LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
        NM="$(NM_FOR_TARGET)"; export NM; \
        RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
        WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
        SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \
        @SET_GCC_LIB_PATH@ \
        echo Configuring in $(TARGET_SUBDIR)/libobjc; \
        cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \
        case $(srcdir) in \
....
Comment 16 Andrew Pinski 2006-03-22 06:43:20 UTC
So something is really wrong.
How did you configure GCC and build GCC.
Comment 17 Issac Trotts 2006-03-22 06:53:10 UTC
Subject: Re:  Checking for gthread causes configure script to fail

I did this:

$ cd ~/downloads/gcc-3.4.6
$ ./configure --enable-threads && make
$ cd libobjc
$ ./configure

Did I leave something out?

On 22 Mar 2006 06:43:21 -0000, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #16 from pinskia at gcc dot gnu dot org  2006-03-22 06:43 -------
> So something is really wrong.
> How did you configure GCC and build GCC.
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26794
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
Comment 18 Andrew Pinski 2006-03-22 06:55:53 UTC
(In reply to comment #17)
> Subject: Re:  Checking for gthread causes configure script to fail
> 
> I did this:
> 
> $ cd ~/downloads/gcc-3.4.6
> $ ./configure --enable-threads && make
> $ cd libobjc
> $ ./configure

Oh that is the issue, libobjc is configured automatically and is done correctly from the toplevel so you messing up by not following the instructions.

All you need to do to configure GCC and build all of GCC is:
> $ cd ~/downloads/gcc-3.4.6
> $ ./configure --enable-threads && make

Though really you should be configuring in a different directory than the source directory.
Comment 19 Issac Trotts 2006-03-22 08:25:04 UTC
Subject: Re:  Checking for gthread causes configure script to fail

On 22 Mar 2006 06:55:53 -0000, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #18 from pinskia at gcc dot gnu dot org  2006-03-22 06:55 -------
> (In reply to comment #17)
> > Subject: Re:  Checking for gthread causes configure script to fail
> >
> > I did this:
> >
> > $ cd ~/downloads/gcc-3.4.6
> > $ ./configure --enable-threads && make
> > $ cd libobjc
> > $ ./configure
>
> Oh that is the issue, libobjc is configured automatically and is done correctly
> from the toplevel so you messing up by not following the instructions.
>
> All you need to do to configure GCC and build all of GCC is:
> > $ cd ~/downloads/gcc-3.4.6
> > $ ./configure --enable-threads && make
>
> Though really you should be configuring in a different directory than the
> source directory.

OK, I just read the directions in the INSTALL directory and came up with this:

cd ~/downloads
mkdir objdir
cd objdir
../gcc-3.4.6/configure --enable-languages=c,objc --enable-threads
--enable-objc-gc
make bootstrap

It configured and built without any problems.

Thanks very much for your help, and sorry about the false alarm.

Issac