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

Codechange: [MinGW] use pe-bigobj-x86-64 format for x64 debug builds #10142

Merged
merged 1 commit into from Nov 6, 2022

Conversation

glx22
Copy link
Contributor

@glx22 glx22 commented Nov 6, 2022

Motivation / Problem

When trying to understand why #10001 compilation was failing for MinGW x64 debug builds, I compared objdump -t network_command.cpp.obj from master and #10001.

objdump -t snippet for #10001
[85159](sec -32108)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x0000000000000000 .refptr._Z19CmdClearOrderBackup13DoCommandFlag9TileIndex8ClientID
objdump -t snippet for master
[80970](sec 31671)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x0000000000000000 .refptr._Z19CmdClearOrderBackup13DoCommandFlag9TileIndex8ClientID

I noticed a lot of negative section values in #10001, so I though maybe we have too many sections (even if the compiler doesn't complain about that). I then tried to enable pe-bigobj-x86-64 and that solved the issue for #10001.

Then I decided to test something and commented out the ASLR disabling, and #10001 still build fine.
So I tried the same on master, and it builds too.

So in the end it seems OpenTTD again managed to hit some compiler limits (remember the settings hell on macos).

Description

Add -Wa,-mbig-obj compile flag for MinGW x64 debug builds.
As a side effect, ASLR disabling in link options is not needed anymore, and removed.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Copy link
Member

@TrueBrain TrueBrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even ... how do you figure out these things?

@michicc michicc merged commit c294e8b into OpenTTD:master Nov 6, 2022
@glx22 glx22 deleted the mingw branch November 6, 2022 11:29
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.

None yet

3 participants