Bug 47098 - i686-openbsd3.0: OBSD_LIB_SPEC missing
Summary: i686-openbsd3.0: OBSD_LIB_SPEC missing
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks: 47093
  Show dependency treegraph
 
Reported: 2010-12-29 02:00 UTC by Jorn Wolfgang Rennecke
Modified: 2018-05-07 20:19 UTC (History)
2 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: i686-openbsd3.0
Build:
Known to work: 6.0
Known to fail: 4.8.0, 4.9.2
Last reconfirmed: 2015-04-10 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorn Wolfgang Rennecke 2010-12-29 02:00:57 UTC
../../../gcc/gcc/gcc.c:684:31: error: ‘OBSD_LIB_SPEC’ undeclared here (not in a function)
make[2]: *** [gcc.o] Error 1
Comment 1 Jorn Wolfgang Rennecke 2012-09-21 15:38:08 UTC
The error looks like this now:

g++   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include  -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber    \
  -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -DSTANDARD_EXEC_PREFIX=\"/usr/local/lib/gcc/\" -DSTANDARD_LIBEXEC_PREFIX=\"/usr/local/libexec/gcc/\" -DDEFAULT_TARGET_VERSION=\"4.8.0\" -DDEFAULT_TARGET_MACHINE=\"i686-openbsd3.0\" -DSTANDARD_BINDIR_PREFIX=\"/usr/local/bin/\" -DTOOLDIR_BASE_PREFIX=\"../../../../\"  `test "X${SHLIB}" = "X" || test "yes" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` -DCONFIGURE_SPECS="\"\"" \
  -c ../../../gcc/gcc/gcc.c -o gcc.o)
In file included from ./tm.h:24:0,
                 from ../../../gcc/gcc/gcc.c:37:
../../../gcc/gcc/config/openbsd.h:144:18: error: ‘OBSD_LIB_SPEC’ was not declared in this scope
 #define LIB_SPEC OBSD_LIB_SPEC
                  ^
../../../gcc/gcc/gcc.c:716:31: note: in expansion of macro 'LIB_SPEC'
 static const char *lib_spec = LIB_SPEC;
                               ^
make[2]: *** [gcc.o] Error 1
rm gcj-dbtool.pod jcf-dump.pod gcj.pod cpp.pod fsf-funding.pod gij.pod gc-analyze.pod grmic.pod gccgo.pod gcc.pod gfortran.pod jv-convert.pod gfdl.pod gcov.pod
make[2]: Leaving directory `/home/amylaar/fsf/multi/i686-openbsd3.0/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/amylaar/fsf/multi/i686-openbsd3.0'
Comment 2 Bernhard Reutner-Fischer 2015-04-10 15:50:06 UTC
I see 2 ways to fix this, fwiw:

1)

diff --git a/gcc/config/openbsd-oldgas.h b/gcc/config/openbsd-oldgas.h
index 04a4d37..0e2aebc 100644
--- a/gcc/config/openbsd-oldgas.h
+++ b/gcc/config/openbsd-oldgas.h
@@ -20,3 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 
 
 #define OBSD_OLD_GAS
+
+/* OpenBSD3.0 had no libpthread, pthreads lived in -lc_r */
+#define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}}"


i.e. openbsd-oldgas.h is only used on i?86-*-openbsd2.*|i?86-*openbsd3.[0123] so is right on spot it seems.

2) Remove openbsd <= 3.3 support altogether since openbsd-3.3 was released May 1, 2003.
This probably needs an announcement from Release Managers or something.
Comment 3 Bernhard Reutner-Fischer 2015-04-22 08:41:45 UTC
Author: aldot
Date: Wed Apr 22 08:41:13 2015
New Revision: 222315

URL: https://gcc.gnu.org/viewcvs?rev=222315&root=gcc&view=rev
Log:
PR target/47098 OBSD_LIB_SPEC on i686-openbsd3 missing

config-list.mk for i686-*-openbsd3.0 failed with:

gcc/config/openbsd.h:143:18: error: ‘OBSD_LIB_SPEC’ was not declared in this scope
 #define LIB_SPEC OBSD_LIB_SPEC
                  ^
gcc/gcc.c:879:31: note:
in expansion of macro ‘LIB_SPEC’
 static const char *lib_spec = LIB_SPEC;
                               ^
make[2]: *** [gcc.o] Error 1

i.e. openbsd-oldgas.h is only used on
i?86-*-openbsd2.*|i?86-*openbsd3.[0123] so add the OBSD_LIB_SPEC there


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/openbsd-oldgas.h
Comment 4 Bernhard Reutner-Fischer 2015-04-22 08:45:48 UTC
Fixed on the trunk.
Comment 5 Eric Gallager 2018-05-07 20:19:16 UTC
(In reply to Bernhard Reutner-Fischer from comment #4)
> Fixed on the trunk.

If trunk was 6 at the time, then this bug is fixed overall, since no older branches are still open.