public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC Build Errors
@ 2021-12-13  1:23 Jamie Lee
  2021-12-13 13:37 ` Stefan Ring
  0 siblings, 1 reply; 4+ messages in thread
From: Jamie Lee @ 2021-12-13  1:23 UTC (permalink / raw)
  To: gcc-help

Hello,

I am attempting to build GCC 11.2.0 in a chroot environment, for use in some projects.
Unfortunately, I am running into errors in the chroot environment, and I'm not sure what's going on.

When building GCC, I am getting these errors:

/usr/bin/ld: .libs/gets-chk.o: in function `__gets_chk':
/src/libssp/gets-chk.c:74: warning: the `gets' function is dangerous and should not be used.
/usr/bin/ld: .libs/ssp.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: .libs/gets-chk.o: warning: relocation against `stdin@@GLIBC_2.2.5' in read-only section `.text'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:533: libssp.la] Error 1
make[3]: Leaving directory '/build/x86_64-pc-linux-gnu/libssp'
make[2]: *** [Makefile:441: all] Error 2
make[2]: Leaving directory '/build/x86_64-pc-linux-gnu/libssp'
make[1]: *** [Makefile:13700: all-target-libssp] Error 2

I am using

/src/configure --prefix=/usr \
LD=ld \
--enable-languages=c,c++ \
--disable-multilib \
--disable-bootstrap \
--enable-host-shared \
--enable-shared \
--with-system-zlib

and

make -j$(nproc)

to build GCC. From what I understand, --enable-host-shared and --enable-shared should fix the relocation R_X86_64_32 error, but it isn't.

Sorry if this is the wrong mailing list, but I'm not really sure where to go for assistance.

Thank you very much.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GCC Build Errors
  2021-12-13  1:23 GCC Build Errors Jamie Lee
@ 2021-12-13 13:37 ` Stefan Ring
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Ring @ 2021-12-13 13:37 UTC (permalink / raw)
  To: gcc-help

On Mon, Dec 13, 2021 at 2:24 AM Jamie Lee via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> /usr/bin/ld: .libs/gets-chk.o: in function `__gets_chk':
> /src/libssp/gets-chk.c:74: warning: the `gets' function is dangerous and should not be used.
> /usr/bin/ld: .libs/ssp.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: .libs/gets-chk.o: warning: relocation against `stdin@@GLIBC_2.2.5' in read-only section `.text'
> collect2: error: ld returned 1 exit status
> make[3]: *** [Makefile:533: libssp.la] Error 1
> make[3]: Leaving directory '/build/x86_64-pc-linux-gnu/libssp'
> make[2]: *** [Makefile:441: all] Error 2
> make[2]: Leaving directory '/build/x86_64-pc-linux-gnu/libssp'
> make[1]: *** [Makefile:13700: all-target-libssp] Error 2

Which environment are you building in? The first thing I would try is
skip the --disable-bootstrap.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* GCC Build Errors
@ 2021-06-12 22:51 FOSSilized_Daemon
  0 siblings, 0 replies; 4+ messages in thread
From: FOSSilized_Daemon @ 2021-06-12 22:51 UTC (permalink / raw)
  To: gcc-help

Hello everyone,

I have been working on a project for the past few months (year(s)?) that requires me to build a cross-compiler toolchain which is to be used to build the actual base operating system (GNU toolchain, Linux kernel, init system, etc). The cross-compiler toolchain is nothing overly complicated just:

- binutils
- linux kernel headers
- glibc headers
- glibc
- gcc

This project is a long term investment on my part and is, essentially, a custom GNU/Linux distribution for myself. In the past few weeks I have been working on writing the steps for building the GNU cross-compiler toolchain (as described above), and recently ran into some trouble. While I have been able to get binutils, linux kernel headers, glibc headers (kinda) installing and working, I can't seep to get GCC pass I to build properly. After some debugging I was able to determine that is *seems* that GCC is failing on warnings, but building with `--disable-werror` doesn't seem to solve the problem. When I build GCC on pass I I use the following steps:

tar -xvf gcc-11.1.0.tar.xz
mkdir -p gcc-11.1.0/build-gcc/local-install
cd gcc-11.1.0/
export local_install="${ACID_BUILDS}"/gcc-11.1.0/build-gcc/local-install
./contrib/download_prerequisites

export CFLAGS="-I${ACID_TEMP_TOOLS}/usr/include -I${ACID_TEMP_TOOLS}/usr/x86_64-pc-linux-gnu/include"
export CXXFLAGS="-I${ACID_TEMP_TOOLS}/usr/include -I${ACID_TEMP_TOOLS}/usr/x86_64-pc-linux-gnu/include"

../configure --prefix="${local_install}" --with-sysroot="${ACID_TEMP_TOOLS}" --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --enable-languages=c --enable-multilib
make
make install

but for some reason GCC keeps throwing errors about functions not being defined and then ending complication on the initial make. I apologize for reaching out as I know you are all very busy, but I have been debugging this issue all week and can't seem to figure out the solution to getting GCC to build properly for pass I. I have reviewed the documentation and even reached out to some communities, but the diagnoses I get from other people seems to be that it is possibly some bug in the GCC build system, but I am not familiar enough with GCC to determine if that is correct. Has anyone here by chance experienced similar issues when compiling GCC pass I for a cross-compiler toolchain? I am not actively using any documentation to build this cross-compiler toolchain, aside from the official documentation and `--help` from GNU and random posts I find around the internet, I am documenting my steps for my personal project in case they are of any help in diagnosis; said steps can be found on my repository [here](https://gitlab.com/FOSSilized_Daemon/nexus/-/blob/master/doc/guides/nexus-for-pcs/sections/building-the-base-os-notes.md) (note that `--disable-werror` is not included in these steps and that I had to manually install the glibc headers as for some reason glibc installs said headers into `$ACID_TEMP_TOOLS/$PWD/usr/include` instead of `$ACID_TEMP_TOOLS/usr/include` this seems to be an issue with how I am specifying the installation location, but I am still trying to figure out how to fix that as well) and the GCC error.log and build.log can be found [here](https://gitlab.com/FOSSilized_Daemon/nexus/-/blob/master/doc/guides/nexus-for-pcs/sections/gcc-error.log) and [here](https://gitlab.com/FOSSilized_Daemon/nexus/-/blob/master/doc/guides/nexus-for-pcs/sections/gcc-build.log) (these are without --disable-werror). For clarification the values of the environment variables I am using in these steps are simply:

- ACID_ROOT=/home/user/.builds/acid-project/acid-root
- ACID_TEMP_TOOLS=/home/user/.builds/acid-project/acid-root/temporary-tools
-ACID_BUILDS=/home/user/.builds/software/building

Again, I apologize for taking up your time. Thank you for reading.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* gcc build errors
@ 2000-10-03 10:20 Jeff Keen
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Keen @ 2000-10-03 10:20 UTC (permalink / raw)
  To: gcc-help

I'm building gcc 2.95 on a dgux elf system (config guess m88k-dg-dguxR4.11MU05
which looks right).  We currently have gcc 2.6.3 working from dg.  The gmake
fails with the message:

----------------------------------------------------------------------------
-----
/usr/local/gcc/src/gcc-2.95.2/gcc
-I/usr/local/gcc/src/gcc-2.95.2/gcc/config -I/
usr/local/gcc/src/gcc-2.95.2/gcc/../include -c -DL${name} \
       /usr/local/gcc/src/gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  ` if [ -f /usr/local/gcc/build/gcc/../binutils/ar ] ; then echo
/usr/local/gcc
/build/gcc/../binutils/ar ; else if [ "m88k-dg-dguxR4.11MU05" =
"m88k-dg-dguxR4.
11MU05" ] ; then echo ar; else t='s,x,x,'; echo ar | sed -e $t ; fi; fi` rc
tmpl
ibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_muldi3
_divdi3
/usr/local/gcc/src/gcc-2.95.2/gcc/libgcc2.c: In function `__divdi3':
/usr/local/gcc/src/gcc-2.95.2/gcc/libgcc2.c:684: internal
error--unrecognizable
insn:
(insn 935 444 936 (set (reg:CCEVEN 7 r7)
        (rotate:CC (reg:CC 9 r9)
            (const_int 2 [0x2]))) -1 (nil)
    (nil))
gmake[2]: *** [libgcc2.a] Error 1
gmake[2]: Leaving directory `/usr/local/gcc/build/gcc'
gmake[1]: *** [bootstrap] Error 1
gmake[1]: Leaving directory `/usr/local/gcc/build/gcc'
gmake: *** [bootstrap] Error 1

----------------------------------------------------------------------------
------

I don't know what an unrecognizable insn is and what do to about it.
the config only has a different --prefix, everything else is configured on
the defaults.



Jeff Keen
Manager of Information Systems
The Fluid Life Corp.
keen@fluidlife.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-13 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13  1:23 GCC Build Errors Jamie Lee
2021-12-13 13:37 ` Stefan Ring
  -- strict thread matches above, loose matches on Subject: below --
2021-06-12 22:51 FOSSilized_Daemon
2000-10-03 10:20 gcc build errors Jeff Keen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).