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

lha: fix Xcode 12 build issues #66361

Closed
wants to merge 1 commit into from

Conversation

mitchblank
Copy link
Contributor

There are actually two separate problems that got triggered by Xcode 12's decision to make -Werror,-Wimplicit-function-declaration the default:

There are actually two separate problems that got triggered by
Xcode 12's decision to make -Werror,-Wimplicit-function-declaration
the default:

* The configure script has problems.  Some of these can be fixed
  with an autoreconf run, but the non-HEAD version of the code
  needs other adjustments to work with modern autoconf.  However
  there are a couple other problems which I opened an upstream PR
  for already: jca02266/lha#18

* There is also a build issue.  macports already has a fix for that:
  macports/macports-ports#9197

However the simplest thing to do for the moment is to just disable
the warning via $CFLAGS which allows the code to build as-is
@ryandesign
Copy link

  • the simplest thing to do for the moment is to just disable the warning via $CFLAGS which allows the code to build as-is

but possibly be wrong or crash on Apple Silicon. (Why do you think Apple made this an error in the first place?) Better to fix it properly.

@mitchblank
Copy link
Contributor Author

but possibly be wrong or crash on Apple Silicon. (Why do you think Apple made this an error in the first place?) Better to fix it properly.

We're dealing with a lot of Xcode 12 failures that are due to this error change (you can look through my recent PRs for a bunch of them, and I'm not the only person who has been working on this) The most typical places this happens is when some simple code -- often in an autoconf fragment -- does something as simple as call exit(0); without having done #ifdef <stdlib.h> There is little risk that this would do the wrong thing.

I 100% agree with you that the best fix is to make a real fix which is why I have been upstream ideal fixes whenever I can. In this case I assume that you are on top of it for your macports change; as you can see I've opened a PR on upstream for the configure issue I diagnosed. However, until the next upstream release I think the $CFLAGS workaround is fine.

WRT your macports change, how risky do you see that one -- I don't know enough about the apple ARM ABI to know if the implicit function signature is likely to cause a mismatch there.

@ryandesign
Copy link

My understanding is that the ARM machine code for calling a function is different depending on whether the function is variadic or non-variadic. The compiler can't know whether the function is variadic or non-variadic without seeing the function declaration. If it guesses wrong, the program will crash. I assume it would guess that the function is non-variadic, and since exit is non-variadic, suppressing the error would probably be ok in this case.

@BrewTestBot
Copy link
Member

🤖 A scheduled task has triggered a merge.

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Jan 7, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants