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

compile with xcode issus (show wifi but not connect) #926

Open
alighafourian opened this issue Oct 24, 2023 · 10 comments
Open

compile with xcode issus (show wifi but not connect) #926

alighafourian opened this issue Oct 24, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@alighafourian
Copy link

alighafourian commented Oct 24, 2023

Have You Read Our Docs
Yes

Are You Reporting A Bug
Yes
Environment

  • Kext Version:
  • WiFi Card Model:7265N
  • PCI Product ID: (0x8086, 0x5002)
  • macOS Version: 14.1

Description
I download code file and compiler . compile done but show wifi and dosnt connect

Bug Report Archive

Screenshot 2023-10-24 at 12 50 05
Screenshot 2023-10-24 at 12 52 24
Screenshot 2023-10-24 at 12 54 37

kext log:
Log_2023-10-24_12-41-37.log

Kext Download Source

@ShroomKing
Copy link

ShroomKing commented Oct 24, 2023

Same when building from source with latest Xcode, GitHub release build works fine though.

@alighafourian
Copy link
Author

@ShroomKing
only way fork on github and run xcode Workflow

@diepeterpan
Copy link

diepeterpan commented Oct 24, 2023

I just did a test, downloaded the source, compiled it, and verified the resulting .kext in Sonoma and everything seems fine. Here is a breakdown of how I compiled it. It is just my way, not necessarily the correct way, but it worked :-)

1)    Download and install Xcode from the App Store

2)    Download the latest OpenIntelWireless source
If you prefer using Git command line or Desktop app and am comfortable using them then by all means use it to download the source and fork where required

3)    Unzip the source OpenIntelWireless to e.g. itlwm-master



4)    Download the latest MacKernelSDK

5)    Unzip to source to OpenIntelWireless root e.g. itlwm-master
PS. Ensure it is named MacKernelSDK
image

6)    Now open itlwm.xcodeproj using XCode



7)    Click menu item [Product] and choose [Build] It should build without errors, at least mine did

8)    By default it seems to build itlwm.kext
image

9)    To build AirportItlwm change the scheme in the [Product] menu to [AirportItlwm (all)]
image

I did test the resulting kext and it is working.
image

@alighafourian
Copy link
Author

@diepeterpan
ok i close issus

@ShroomKing
Copy link

I did more tests.
This appears to be a compiler code optimisation problem.

When creating a debug build it uses optimisation level 0 and the kext works.

But when creating an optimised build (Release build type / Product->Archive) the kext can't connect to wifi.

The highest optimisation level that works right now is 1, so I assume some flag in level 2 is breaking the code (more info here: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html)

You can disable optimisation flags by using -fno-(flag-name) so for example to disable -falign-functions add -fno-align-functions to CFLAGS, this way we can keep the other optimisations but I don't know if there's a better way to debug this than trying to disable all the flags one by one.

@usr-sse2
Copy link
Contributor

The highest optimisation level that works right now is 1, so I assume some flag in level 2 is breaking the code (more info here: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html)

It's better to look options in Clang documentation because Xcode compiles with Clang, not GCC.

@zxystd
Copy link
Collaborator

zxystd commented Mar 12, 2024

The highest optimisation level that works right now is 1, so I assume some flag in level 2 is breaking the code (more info here: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html)

It's better to look options in Clang documentation because Xcode compiles with Clang, not GCC.

@usr-sse2 You are right, but I don't have the time and environment(no Sonoma/new XCode) to investigate this, if you have discoveries please let me know or open an PR, thank you!

@zxystd zxystd reopened this Mar 12, 2024
@zxystd zxystd added the enhancement New feature or request label Mar 12, 2024
@zxystd
Copy link
Collaborator

zxystd commented Mar 12, 2024

From the log I can see the root issue is that the optimization breaks function ieee80211_get_assoc_req, with invalid assoc request(RSN invalid), for what's the differences I can't see with the decompiled code.

@vanyasem
Copy link

@zxystd I can confirm that the issue is resolved with the latest commits. Release builds are now able to connect to Wi-Fi successfully. Tested on Sonoma 14.4

@alighafourian
Copy link
Author

@zxystd I can confirm that the issue is resolved with the latest commits. Release builds are now able to connect to Wi-Fi successfully. Tested on Sonoma 14.4

Compile with xcode app
If use terminal for build wifi can not connect but show
If use xcode app work good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

6 participants