From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.markwbutt.com (smtp.markwbutt.com [51.222.106.99]) by sourceware.org (Postfix) with ESMTP id CF24A3858D32 for ; Sun, 22 Jan 2023 17:38:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF24A3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=markwbutt.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=markwbutt.com Received: from efa.jam.icn (efa.jam.icn [192.168.100.20]) by smtp.markwbutt.com (Postfix) with ESMTPS id 10F13C0159 for ; Sun, 22 Jan 2023 14:08:06 -0330 (NST) X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_NUMSUBJECT,KAM_SHORT,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 DKIM-Filter: OpenDKIM Filter v2.11.0 efa.jam.icn 4P0L6c6B19zCmJs X-JAMNet-MailScanner-EFA-Watermark: 1675013871.86286@2B+ndp4MgE9qY2UDKYfTZg X-JAMNet-MailScanner-EFA-From: mark@markwbutt.com X-JAMNet-MailScanner-EFA: Found to be clean X-JAMNet-MailScanner-EFA-ID: 4P0L6P10nvzCmJs X-JAMNet-MailScanner-EFA-Information: Please contact mark@markwbutt.com for more information Received: from mail.jam.icn (mail.jam.icn [192.168.100.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (no client certificate requested) by efa.jam.icn (MailScanner Milter) with SMTP id 4P0L6P10nvzCmJs; Sun, 22 Jan 2023 14:07:49 -0330 (NST) DKIM-Filter: OpenDKIM Filter v2.11.0 efa.jam.icn 4P0L6P10nvzCmJs Received: from mail.jam.icn (localhost [127.0.0.1]) by mail.jam.icn (Postfix) with ESMTPS id D09214311AA1; Sun, 22 Jan 2023 14:07:33 -0330 (NST) Received: from mail.jam.icn ([127.0.0.1]) by localhost (mail.jam.icn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2bAD5f5nB8Vk; Sun, 22 Jan 2023 14:07:33 -0330 (NST) Received: from mail.jam.icn (localhost [127.0.0.1]) by mail.jam.icn (Postfix) with ESMTP id 8E68D4311AA1; Sun, 22 Jan 2023 14:07:33 -0330 (NST) Date: Sun, 22 Jan 2023 14:07:33 -0330 (NST) From: Mark Butt To: Jonathan Wakely Cc: gcc-help@gcc.gnu.org Message-ID: <1069636641.353816.1674409053357.JavaMail.zimbra@markwbutt.com> In-Reply-To: References: Subject: Re: Building and install GCC 8.3.0, OpenBSD 7.2 on DEC Alpha EV5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.100.10] X-Mailer: Zimbra 9.0.0_ZEXTRAS_20220713 (ZimbraWebClient - GC87 (Mac)/9.0.0_ZEXTRAS_20220713) Thread-Topic: Building and install GCC 8.3.0, OpenBSD 7.2 on DEC Alpha EV5 Thread-Index: Q7sGpnNUFtjPLWCjIWTKSgijjcrR/A== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Jonathan, Thanks for your fast reply! My answers and comments are below. There is a= lso an update at the very bottom. >> Hi Everyone, >> >> I have OpenBSD 7.2 installed and running on an AlphaServer 4100. DEC Al= pha EV5 >> processors. >> No major issues with getting it running on this old hardware other than = a slight >> bug one of the developers over at OpenBSD squashed for me. >> >> I have been having great success with building modern tools and software= on the >> system. No problems at all. Except for one=E2=80=A6 >> >> A particular piece of software I am trying to build requires GCC 8.3.0 w= hich is >> much newer than the version that comes with OpenBSD. I am attempting to= build >> and install GCC 8.3.0 in a separate location from the main system compil= er as >> OpenBSD doesn=E2=80=99t usually take kindly to having its system compile= r version >> changed. >> >> I have used the gcc-8.3.0 included script to download and extract the >> dependancies that GCC will need. I have also downloaded, compiled and >> installed the latest version of binutils. Installed to /usr/local >> >> These are the configure and make commands I am using, and I am running t= his in a >> location NOT in the source tree. >=20 > All that info rules out 90% of the questions on this list, so that's a > great start! >=20 > Do you really need gcc-8.3.0 specifically? You should generally use > the newest from a given release series. If you need gcc-8 then 8.5.0 > would be my choice. Why would 8.3.0 be better than 8.5.0? >=20 No, there is no reason to be at 8.3.0 other than this was the minimum requi= red. I thought that I might have better luck getting 8.3 to work vs a newer version given the age of the hardware, I will, however, try a newer= version as suggested. Would you recommend going with a particular version or just get the latest = and greatest? >> bash-5.2# pwd >> /u01/software/gcc/build-gcc-8.3.0 >> >> bash-5.2# ../gcc-8.3.0/configure CFLAGS=3D"-I/usr/include -I/usr/local/i= nclude" >> LDFLAGS=3D"-L/usr/lib -L/usr/local/lib" --disable-multilib --disable-cet >> --enable-language=3Dc,c++ --prefix=3D/usr/local --disable-nls >=20 > Why are you setting those CFLAGS and LDFLAGS? Aren't those the default > locations that are always searched anyway? >=20 Yes, I assumed they would be defaulted as well. Several postings on variou= s forums/mailing lists about building with GCC on OpenBSD recommended setti= ng them exclusively, but I will try the build again without specifying them to see if that helps. >> bash-5.2# /usr/local/bin/make >> >> Things appear to go well for quite a while (two 300Mhz processors), then= the >> make dies with: >> >> gcc -c -DHAVE_CONFIG_H -I/usr/include -I/usr/local/include -I. >> -I../../../gcc-8.3.0/libiberty/../include -W -Wall -Wwrite-strings >> -Wc++-compat -Wstr10:31:49 [22/1989] >> dantic -D_GNU_SOURCE ../../../gcc-8.3.0/libiberty/objalloc.c -o objallo= c.o >> ../../../gcc-8.3.0/libiberty/objalloc.c: In function 'objalloc_create=E2= =80=99: >> ../../../gcc-8.3.0/libiberty/objalloc.c:95: error: 'PTR' undeclared (fir= st use >> in this function) > [...] >> I took a look at ../gcc-8.3.0/libiberty/objalloc.c and it appears to be= having >> issues with: >> Line 95 referenced in the error above: ret->chunks =3D (PTR) malloc (CH= UNK_SIZE); >> >> This could entirely be down to me going about this endeavour the wrong w= ay. I >> have been doing a lot of reading, and experimenting over the past two we= eks=E2=80=A6 >> but not much luck getting past this. I have tried the default shell for >> OpenBSD as well as the bash shell noted above incase there was something= about >> the bash install I did=E2=80=A6 I have a personal preference towards bas= h :) >=20 > This has nothing to do with your shell. PTR should be defined by > include/ansidecl.h >=20 > #if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || > (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) > /* All known AIX compilers implement these things (but don't always > define __STDC__). The RISC/OS MIPS compiler defines these things > in SVR4 mode, but does not define __STDC__. */ > /* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other > C++ compilers, does not define __STDC__, though it acts as if this > was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */ >=20 > #define PTR void * > [...] > #else /* Not ANSI C. */ >=20 > #define PTR char * >=20 >=20 > So it's either defined to void* or to char*. I don't see how it can be > undefined, if that file has been included properly. Right at the top > of libiberty/objalloc.c we have: >=20 > #include "config.h" > #include "ansidecl.h" >=20 > You'll need to figure out what's happening there. Go into the > /u01/software/gcc/build-gcc-8.3.0/build-alpha-unknown-openbsd7.2/libibert= y > build directory and run make (without any -j option). That will give > you the gcc command being run to build objalloc.o (which is shown > above, but seems to have a "10:31:49 [22/1989]" in it, maybe from your > terminal or something). Sorry about that, those extra characters, "10:31:49 [22/1989]" , are comi= ng from tmux.=20 >=20 > Re-run that command with -save-temps added and then inspect the > objalloc.i file to see if ansidecl.h is being included, and if so, > which path it's being found in. It should be the one in the gcc-8.3.0 > source tree, at gcc-8.3.0/include/ansidecl.h > Is some other ansidecl.h elsewhere in your filesystem being found? > I strongly suspect it is, because of your custom CFLAGS: > -I/usr/include -I/usr/local/include -I. > -I../../../gcc-8.3.0/libiberty/../include You are correct! Another version is being discovered... =20 # 1 "/usr/local/include/ansidecl.h" >=20 > The third path there is the one that should lead to ansidecl.h but if > a file with that name is present in /usr/include or /usr/local/include > then things will break. *** BEGIN UPDATE *** I made the changes to the configure command that were suggested and the bui= ld moves along much further. It now stops with an error indicating that crt1.o cannot be found when buil= ding libgomp. I have a crt0.o but not a crt1.o Is that something that I can/should build? Or is there another change I sh= ould make to the configure command? I know the documentation for the configure options for gcc indicates that y= ou should keep it simple... perhaps, that might be my problem... Again, if anyone is able to easily say what they think the problem is, plea= se let me know. =20 This is the latest configure command that I have used. bash-5.2# ../gcc-8.3.0/configure --disable-multilib --disable-cet --enable-= language=3Dc,c++ --prefix=3D/usr/local --disable-nls --disable-lto I also tried gcc-8.5.0 with the same result... 8.5.0 is definitely what I w= ill be trying to get to work from here out. bash-5.2# ../gcc-8.5.0/configure --disable-multilib --disable-cet --enable-= language=3Dc,c++ --prefix=3D/usr/local --disable-nls --disable-lto I pulled this blurb off a support post from a forum: *** BEGIN *** Both crt0/crt1 do the same thing, basically do what is needed before callin= g main() (like initializing stack, setting irqs, etc.). You should link wit= h one or the other but not both. They are not really libraries but really i= nline assembly code. As far as I understand, crt comes in two "flavours" crt1 is used on systems that support constructors and destructors (function= s called before and after main and exit). In this case main is treated like= a normal function call. crt0 is used on systems that do not support constructors/destructors. *** END *** The following is the message that I am getting when trying to build gcc 8.5= .0: *** BEGIN *** Checking multilib configuration for libgomp... = =20 Configuring stage 1 in alpha-unknown-openbsd7.2/libgomp = = =20 configure: loading cache ./config.cache = =20 checking for --enable-version-specific-runtime-libs... no = = =20 checking for --enable-generated-files-in-srcdir... no = =20 checking build system type... alpha-unknown-openbsd7.2 = = =20 checking host system type... alpha-unknown-openbsd7.2 = =20 checking target system type... alpha-unknown-openbsd7.2 = = =20 checking for a BSD-compatible install... /usr/bin/install -c = = =20 checking whether build environment is sane... yes = =20 checking for a thread-safe mkdir -p... /usr/local/bin/mkdir -p = = =20 checking for gawk... awk = =20 checking whether /usr/local/bin/make sets $(MAKE)... yes = = =20 checking for alpha-unknown-openbsd7.2-gcc... /u01/software/gcc/gcc-8.5.0_bu= ild-dir/./gcc/xgcc -B/u01/software/gcc/gcc-8.5.0_build-dir/./gcc/ -B/usr/lo= cal/alpha-unknown- openbsd7.2/bin/ -B/usr/local/alpha-unknown-openbsd7.2/lib/ -isystem /usr/lo= cal/alpha-unknown-openbsd7.2/include -isystem /usr/local/alpha-unknown-open= bsd7.2/sys-include checking for C compiler default output file name... = =20 configure: error: in `/u01/software/gcc/gcc-8.5.0_build-dir/alpha-unknown-o= penbsd7.2/libgomp': = =20 configure: error: C compiler cannot create executables = = =20 See `config.log' for more details. = =20 make[2]: *** [Makefile:23756: configure-stage1-target-libgomp] Error 77 = = =20 make[2]: Leaving directory '/u01/software/gcc/gcc-8.5.0_build-dir' = = =20 make[1]: *** [Makefile:25946: stage1-bubble] Error 2 = =20 make[1]: Leaving directory '/u01/software/gcc/gcc-8.5.0_build-dir' = = =20 make: *** [Makefile:952: all] Error 2 *** END *** I looked at the config.log for libgomp: *** BEGIN *** configure:3747: /u01/software/gcc/gcc-8.5.0_build-dir/./gcc/xgcc -B/u01/sof= tware/gcc/gcc-8.5.0_build-dir/./gcc/ -B/usr/local/alpha-unknown-openbsd7.2/= bin/ =20 -B/usr/local/alpha-unknown-openbsd7.2/lib/ -isystem /usr/local/alpha-unknow= n-openbsd7.2/include -isystem /usr/local/alpha-unknown-openbsd7.2/sys-inclu= de =20 -g -O2 -mieee conftest.c >&5 /usr/local/alpha-unknown-openbsd7.2/bin/ld: cannot find crt1.o: No such fil= e or directory /usr/local/alpha-unknown-openbsd7.2/bin/ld: cannot find crti.o: No such fil= e or directory /usr/local/alpha-unknown-openbsd7.2/bin/ld: cannot find crtn.o: No such fil= e or directory collect2: error: ld returned 1 exit status configure:3751: $? =3D 1 configure:3788: result: configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNU Offloading and Multi Processing Runtime Library= " | #define PACKAGE_TARNAME "libgomp" | #define PACKAGE_VERSION "1.0" | #define PACKAGE_STRING "GNU Offloading and Multi Processing Runtime Libra= ry 1.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "http://www.gnu.org/software/libgomp/" | #define PACKAGE "libgomp" | #define VERSION "1.0" | /* end confdefs.h. */ | | int | main () | { |=20 | ; | return 0; | } configure:3794: error: in `/u01/software/gcc/gcc-8.5.0_build-dir/alpha-unkn= own-openbsd7.2/libgomp': configure:3797: error: C compiler cannot create executables See `config.log' for more details. *** END *** If this is rudimentary and my mistakes are from lack of reading/understandi= ng, please point me in the right direction to what I should study. I feel like I should be able to solve this on my own, but not sure where to= start. Thanks Everyone, Thanks again Jonathan! -M *** END UPDATE ***