From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 345F73858D32 for ; Sun, 22 Jan 2023 18:36:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 345F73858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x636.google.com with SMTP id ud5so25482159ejc.4 for ; Sun, 22 Jan 2023 10:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=13bH/T1g/jqlu8cIWgOiia5frZOUTxDaWa/26wZ/UY8=; b=X90GE67deUGdEiSR1+s4s37NByYGign7X4rbekjUg1z06yG7M1gNYmHvye+eBZznnI E9IzFCRZsGmAtcFQhYnGhsY78Ytb4JXTQMHkwj8vIbgKe8R75Fa5+eMGcMMUSPBrTyYQ TaMCsb0y+k4OdLAsGLHhejOAU4mzsEPlxJXzHSN3KPhEvhEAHT2Su+eSZ1GlofxJP+Jb qITU2eyL3mcyeMHVZdSUrARkN+G/A5AXmHLEkuHpRNAfhjJ3G8AOQVAsU64c1++GgO// KGXOtSSeC0wrnG6PEPcVZP/hadCphH9oUpIm/sRi11UmKH/hj9r8r+qbgxfoc31ScovV i1Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=13bH/T1g/jqlu8cIWgOiia5frZOUTxDaWa/26wZ/UY8=; b=bG/x34xdVqJbBdlO+OEmJYI1HqQWnpQiPhHlu6G3B98MGM8J5ncGGgNQ3sTduawbcR lLtOSyIw9FiIRBkN0M+kQhLn17cmj3Acx592X8uIk73KstpIZaVnWXcyIPmWxCOEBV24 uRM4XAwOd4DcKqN3V/kTNao8UOimTKgOLUh97L66yYEHZDPQ/cPN0ERsc/fRCUUAn0rz LEViJ6nZKuWhdPIcQ8D8bWouP3gOHkBnYWda50Jz7Z0GsmODK4eJCfcxlP0MQu4OPaRK sHFWbVFn/SC8puAcKORAwCSPLMaCB5OznTCKuMCM578Dw2WGuNCdRxZaiHDwbA4jJkrm Dklw== X-Gm-Message-State: AFqh2kqn232vIRckdbuA7LD6Q/oa/35NiEebqUnRkdRVLDV18TRwbui7 1pgP8MxJyFQS/409TDJJuDIyVrIMlqD+YEp+H4xPTnav X-Google-Smtp-Source: AMrXdXuxFcBldAuQ1hsSgdbA4oGts1fZQDfemfiOdFeJ0E0RoJMKP3w1zcqjdI9JmtOnZMODfawlzrDzcZnwdFfSDGA= X-Received: by 2002:a17:906:5393:b0:872:4368:5dd7 with SMTP id g19-20020a170906539300b0087243685dd7mr3086835ejo.601.1674412573711; Sun, 22 Jan 2023 10:36:13 -0800 (PST) MIME-Version: 1.0 References: <1069636641.353816.1674409053357.JavaMail.zimbra@markwbutt.com> In-Reply-To: <1069636641.353816.1674409053357.JavaMail.zimbra@markwbutt.com> From: Jonathan Wakely Date: Sun, 22 Jan 2023 18:36:02 +0000 Message-ID: Subject: Re: Building and install GCC 8.3.0, OpenBSD 7.2 on DEC Alpha EV5 To: Mark Butt Cc: gcc-help Content-Type: multipart/alternative; boundary="000000000000a9e17b05f2de8e3c" X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,KAM_NUMSUBJECT,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000a9e17b05f2de8e3c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 22 Jan 2023, 17:38 Mark Butt, wrote: > Hi Jonathan, > > Thanks for your fast reply! My answers and comments are below. There is > also an update at the very bottom. > > >> Hi Everyone, > >> > >> I have OpenBSD 7.2 installed and running on an AlphaServer 4100. DEC > Alpha 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 > which 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 > compiler as > >> OpenBSD doesn=E2=80=99t usually take kindly to having its system compi= ler > 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 > this in a > >> location NOT in the source tree. > > > > All that info rules out 90% of the questions on this list, so that's a > > great start! > > > > 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? > > > > No, there is no reason to be at 8.3.0 other than this was the minimum > required. 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? > You should almost always use the newest for the release series you're interested in. If you want gcc 8 then use 8.5.0, but if you just want 8 or later, I see no reason to use an end of life, unsupported release. Use a newer one. > > >> 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/include" > >> LDFLAGS=3D"-L/usr/lib -L/usr/local/lib" --disable-multilib --disable-c= et > >> --enable-language=3Dc,c++ --prefix=3D/usr/local --disable-nls > > > > Why are you setting those CFLAGS and LDFLAGS? Aren't those the default > > locations that are always searched anyway? > > > > Yes, I assumed they would be defaulted as well. Several postings on > various forums/mailing lists about building with GCC on OpenBSD recommend= ed > setting 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 > objalloc.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 > (first 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 > (CHUNK_SIZE); > >> > >> This could entirely be down to me going about this endeavour the wrong > way. I > >> have been doing a lot of reading, and experimenting over the past two > weeks=E2=80=A6 > >> but not much luck getting past this. I have tried the default shell f= or > >> 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 b= ash :) > > > > This has nothing to do with your shell. PTR should be defined by > > include/ansidecl.h > > > > #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) */ > > > > #define PTR void * > > [...] > > #else /* Not ANSI C. */ > > > > #define PTR char * > > > > > > 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: > > > > #include "config.h" > > #include "ansidecl.h" > > > > 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/libiberty > > 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 > coming from tmux. > > > > > 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... > # 1 "/usr/local/include/ansidecl.h" > > > > > 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 > build moves along much further. > It now stops with an error indicating that crt1.o cannot be found when > building libgomp. > Unless you actually need OpenMP you could get past that error by configuring with --disable-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 > should make to the configure command? > I know the documentation for the configure options for gcc indicates that > you should keep it simple... perhaps, that might be my problem... > > Again, if anyone is able to easily say what they think the problem is, > please let me know. > 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-l= to > > I also tried gcc-8.5.0 with the same result... 8.5.0 is definitely what I > will 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-l= to > > 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 > calling main() (like initializing stack, setting irqs, etc.). You should > link with one or the other but not both. They are not really libraries but > really inline assembly code. As far as I understand, crt comes in two > "flavours" > > crt1 is used on systems that support constructors and destructors > (functions 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... > > Configuring stage 1 in alpha-unknown-openbsd7.2/libgomp > > > configure: loading cache ./config.cache > > checking for --enable-version-specific-runtime-libs... no > > > checking for --enable-generated-files-in-srcdir... no > > checking build system type... alpha-unknown-openbsd7.2 > > > checking host system type... alpha-unknown-openbsd7.2 > > checking target system type... alpha-unknown-openbsd7.2 > > > checking for a BSD-compatible install... /usr/bin/install -c > > > checking whether build environment is sane... yes > > checking for a thread-safe mkdir -p... /usr/local/bin/mkdir -p > > > checking for gawk... awk > > checking whether /usr/local/bin/make sets $(MAKE)... yes > > > checking for alpha-unknown-openbsd7.2-gcc... > /u01/software/gcc/gcc-8.5.0_build-dir/./gcc/xgcc > -B/u01/software/gcc/gcc-8.5.0_build-dir/./gcc/ -B/usr/local/alpha-unknown- > openbsd7.2/bin/ -B/usr/local/alpha-unknown-openbsd7.2/lib/ -isystem > /usr/local/alpha-unknown-openbsd7.2/include -isystem > /usr/local/alpha-unknown-openbsd7.2/sys-include > > checking for C compiler default output file name... > > configure: error: in > `/u01/software/gcc/gcc-8.5.0_build-dir/alpha-unknown-openbsd7.2/libgomp': > > configure: error: C compiler cannot create executables > > > See `config.log' for more details. > > make[2]: *** [Makefile:23756: configure-stage1-target-libgomp] Error 77 > > > make[2]: Leaving directory '/u01/software/gcc/gcc-8.5.0_build-dir' > > > make[1]: *** [Makefile:25946: stage1-bubble] Error 2 > > make[1]: Leaving directory '/u01/software/gcc/gcc-8.5.0_build-dir' > > > 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/software/gcc/gcc-8.5.0_build-dir/./gcc/ > -B/usr/local/alpha-unknown-openbsd7.2/bin/ > -B/usr/local/alpha-unknown-openbsd7.2/lib/ -isystem > /usr/local/alpha-unknown-openbsd7.2/include -isystem > /usr/local/alpha-unknown-openbsd7.2/sys-include > -g -O2 -mieee conftest.c >&5 > /usr/local/alpha-unknown-openbsd7.2/bin/ld: cannot find crt1.o: No such > file or directory > /usr/local/alpha-unknown-openbsd7.2/bin/ld: cannot find crti.o: No such > file or directory > /usr/local/alpha-unknown-openbsd7.2/bin/ld: cannot find crtn.o: No such > file 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 > Library 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 () > | { > | > | ; > | return 0; > | } > configure:3794: error: in > `/u01/software/gcc/gcc-8.5.0_build-dir/alpha-unknown-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/understanding, 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 *** > --000000000000a9e17b05f2de8e3c--