Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc: try latest available snapshot (NOT TO BE MERGED) #9034

Closed
wants to merge 4 commits into from

Conversation

oscarfv
Copy link
Contributor

@oscarfv oscarfv commented Jul 3, 2021

... to see if it contains a fix for #8320

@oscarfv oscarfv force-pushed the gcc-11-ada-try-fix branch 3 times, most recently from 9da3546 to 48bb7c0 Compare July 3, 2021 01:16
Oscar Fuentes added 2 commits July 3, 2021 03:38
Change EH pointer encodings to PC relative on Windows
author	Eric Botcazou <[email protected]>
	Fri, 2 Jul 2021 08:21:11 +0000 (10:21 +0200)
committer	Eric Botcazou <[email protected]>
	Fri, 2 Jul 2021 08:27:41 +0000 (10:27 +0200)
commit	014e6aa467b1648d09eab9897ca367bfec5e6b76

Change EH pointer encodings to PC relative on Windows

A big difference between ELF and PE-COFF is that, with the latter, you can
build position-independent executables or DLLs without generating PIC; as
a  matter of fact, flag_pic has historically been forced to 0 for 32-bit:

/* Don't allow flag_pic to propagate since gas may produce invalid code
   otherwise.  */

\
do {
        \
  flag_pic = TARGET_64BIT ? 1 : 0; \
} while (0)

The reason is that the linker builds a .reloc section that collects the
absolute relocations in the generated binary, and the loader uses them to
relocate it at load time if need be (e.g. if --dynamicbase is enabled).

Up to binutils 2.35, the GNU linker didn't build the .reloc section for
executables and defaulted to --enable-auto-image-base for DLLs, which means
that DLLs had an essentially unique load address and, therefore, need not
be relocated by the loader in most cases.

With binutils 2.36 and later, the GNU linker builds a .reloc section for
executables (thus making them PIE), --enable-auto-image-base is disabled
and --dynamicbase is enabled by default, which means that essentially all
the binaries are relocated at load time.

This badly breaks the 32-bit compiler configured to use DWARF-2 EH because
the loader corrupts the .eh_frame section when processing the relocations
contained in the .reloc section.

gcc/
* config/i386/i386.c (asm_preferred_eh_data_format): Always use the
PIC encodings for PE-COFF targets.
@oscarfv
Copy link
Contributor Author

oscarfv commented Jul 3, 2021

This build fails with a configure error on libgomp (on stage 2, if I'm correct). Now trying gcc-11 + EH patch on #9035.

2021-07-03T02:17:29.6847319Z mkdir -p -- i686-w64-mingw32/libgomp
2021-07-03T02:17:29.7431682Z Checking multilib configuration for libgomp...
2021-07-03T02:17:29.8665757Z Configuring stage 1 in i686-w64-mingw32/libgomp
2021-07-03T02:17:34.9920382Z configure: loading site script /etc/config.site
2021-07-03T02:17:35.0190664Z configure: creating cache ./config.cache
2021-07-03T02:17:35.0206347Z checking for --enable-version-specific-runtime-libs... no
2021-07-03T02:17:35.0207899Z checking for --enable-generated-files-in-srcdir... no
2021-07-03T02:17:35.1581938Z checking build system type... i686-w64-mingw32
2021-07-03T02:17:35.2260715Z checking host system type... i686-w64-mingw32
2021-07-03T02:17:35.2979055Z checking target system type... i686-w64-mingw32
2021-07-03T02:17:35.2980274Z checking for a BSD-compatible install... /usr/bin/install -c
2021-07-03T02:17:35.3475058Z checking whether build environment is sane... yes
2021-07-03T02:17:35.4943821Z checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
2021-07-03T02:17:35.4948666Z checking for gawk... gawk
2021-07-03T02:17:35.6139459Z checking whether make sets $(MAKE)... yes
2021-07-03T02:17:35.7099141Z checking whether make supports nested variables... yes
2021-07-03T02:17:35.8748898Z checking for i686-w64-mingw32-gcc... /C/_/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/xgcc -B/C/_/mingw-w64-gcc/src/build-i686-w64-mingw32/./gcc/ -L/mingw32/i686-w64-mingw32/lib -L/mingw32/lib -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/include -B/mingw32/i686-w64-mingw32/bin/ -B/mingw32/i686-w64-mingw32/lib/ -isystem /mingw32/i686-w64-mingw32/include -isystem /mingw32/i686-w64-mingw32/sys-include   -fno-checking
2021-07-03T02:17:36.5474489Z checking whether the C compiler works... yes
2021-07-03T02:17:36.5483808Z checking for C compiler default output file name... a.exe
2021-07-03T02:17:36.8272433Z checking for suffix of executables... .exe
2021-07-03T02:17:37.1259476Z configure: error: in `/C/_/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libgomp':
2021-07-03T02:17:37.1261103Z configure: error: cannot run C compiled programs.
2021-07-03T02:17:37.1262007Z If you meant to cross compile, use `--host'.
2021-07-03T02:17:37.1262718Z See `config.log' for more details
2021-07-03T02:17:37.3458989Z make[2]: *** [Makefile:24035: configure-stage1-target-libgomp] Error 1

@oscarfv oscarfv closed this Jul 3, 2021
@Biswa96
Copy link
Member

Biswa96 commented Jul 3, 2021

You can test any changes in your own forked repository. CI will run same thing.

@oscarfv
Copy link
Contributor Author

oscarfv commented Jul 3, 2021

You can test any changes in your own forked repository. CI will run same thing.

That's news to me, thank you.

(What a waste of electricity!)

@jeremyd2019
Copy link
Member

only if you enable it, you have to go to the "Actions" tab of your fork and allow it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants