-
Notifications
You must be signed in to change notification settings - Fork 139
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
Can't compile with Clang #30
Comments
@awesomebing1 The project itself has been dead for a few years now, I doubt anyone will pick it up to be honest, but you never know :) |
It is? Didn't know that. According to Google, thumb interworking is enabled by default. So, I removed that option. Now, it fails at -Ttext=0x0. Don't know what that flag is for, could you please tell me? |
Someone should really pick up this project; I still use iDroid on my iPhone 3G... but as to your original question, @awesomebing1, what version of clang/llvm are you using? Why doesn't your gcc toolchain work? I managed to get this compiled from source using the iphone-dev toolchain a while back, did you try that? |
I'm using clang 3.6. My gcc toolchain seems to work, but doesn't. It's the one from iDroid-Project/OpeniBoot-toolchain . I truly don't know why it doesn't work, all I know is if you copy an executable over to the device and run it, it gives the annoying "bash: cannot execute binary file" thing. I opened an issue over on that repo, but no replies. |
Also, I'm on Linux (Debian 7) with a PowerPC processor. The PowerPC part may be why the toolchain isn't working, who knows :/ |
@awesomebing1 Why are you trying to run the binary inside of iOS? IIRC it runs directly on bare metal via a bootrom exploit... |
Yes, but what I mean is that my compiler doesn't compile right. It compiles, but I can't run the programs on ARM devices (my iPhone 3GS). That was just a demonstration, since I first figured that it may not work after the reboot after uploading. |
@awesomebing1 Ah, I see what you mean: I'll take a look and see if I can get a binary to compile right on my x86 Debian machine |
I need to temporarily leave due to bad weather. I will be back. Sent from my iPad On Fri, Apr 24, 2015 at 6:11 PM, Josh Max [email protected]
|
@awesomebing1 You aren't by any chance using arm-elf-gcc from the toolchain to try to compile iOS binaries, are you? I don't think iOS accepts ARM ELF binaries; only Mach-O ones. |
My toolchain build does seem to work correctly (just checked the arm-elf-objdump output of some quick hello world code) but it's definitely the wrong toolchain to be using if you want to build userspace binaries for iOS... |
I compiled it with that toolchain, and when it rebooted in both recovery and DFU mode I figured it was broke, and build that. So I've solved the iOS part with the GCC toolchain, but what about it rebooting? I compiled the toolchain, and immediately compiled openiBoot with scons iPhone3GS. Then, I used loadibec to upload the .bin file, and it rebooted. |
@awesomebing1 The iPhone 3GS isn't currently supported yet and is still very much a WIP, so there could be a number of things going wrong with it. First, is your 3GS bootrom 359.3 or 359.3.2? |
The old boot rom, so I would guess the first one. Sent from my iPad On Fri, Apr 24, 2015 at 6:53 PM, Josh Max [email protected]
|
@awesomebing1 Are you using loadibec from the Chronic-Dev syringe repository? |
Nope, the one you guys have under your organization. Sent from my iPad On Fri, Apr 24, 2015 at 7:09 PM, Josh Max [email protected]
|
I'm going to rebuild the toolchain, haven't tried that yet Sent from my iPad On Fri, Apr 24, 2015 at 7:09 PM, Josh Max [email protected]
|
loadibec might also require you to build an img3, I'm not sure though... (I should also note that I have no affiliation with this project other than a couple days of messing around with the OpeniBoot source.) |
I misunderstood. I am using the chromic-dev syringe loadibec. Perhaps that would be the problem? |
@awesomebing1 Try the loadibec from the iDroid OiBC repository instead and see if that fixes anything... Edit: I'm almost certain that loadibec is going to need an img3 image rather than a raw image to work properly. |
Well, that worked, sorta... it just exits with no info (seems to be a known issue) |
Does OpeniBoot work on your 3GS now? |
I take that back. There is no img3 file. In issue #29, Bluerise said the following: So should I switch back to the Chronic-Dev one? I'm so confused :/ |
No, sadly, it does not. |
It tells me it "uploads succesfully" and does nothing. I get the felling this is a linux only problem, I need to try on a Mac. I'll work on this later. |
It outputs the following when in DFU mode: But meanwhile, on the device, it's booting back into iOS. I truely don't know. |
@awesomebing1 Are you sure you're passing an img3 into loadibec rather than a bin? https://github.com/iDroid-Project/OiBC/blob/master/loadibec.c#L126 |
I'm uploading a bin since there is no img3 file. |
Okay, I see that arm-elf-objdump gives the following error for the .bin file: arm-elf-objdump: ../../openiBoot/iphone_3gs_openiboot.bin: File format not recognized Whereas arm-elf-objdump: ../../openiBoot/iphone_3gs_openiboot gives off a bunch of assembly. Perhaps the .bin file is corrupted? |
@awesomebing1 Another day...and fresh eyes to look at the problem. Taking a look at the mk8900image source shows me that scons generates two files, iphone_3gs_openiboot (the raw binary) and iphone_3gs_openiboot.bin (an img3 with a ".bin" extension). So the above commands do seem to be showing what I'd expect... However, I believe you stated that you were attempting to compile this with a PowerPC machine? Looking at this conditional (https://github.com/iDroid-Project/openiBoot/blob/master/mk8900image/SConscript#L10) in the mk8900image SConstruct shows that if the architecture isn't x86_64 (presumably AMD64), it's automatically assumed to be x86 and links with precompiled libs of the wrong architecture? (Correct me if I'm wrong.) What happens if you try to boot your iPhone into DFU mode and flash the raw binary (the non-.bin one)? Does that work instead? |
It does, and that's why I compiled xpwn myself and copied libcommon.a and libxpwn.a over, so it would compile. I tried doing the raw binary, and got the same response with the Chronic-Dev syringe. I looked over at that repo, and found that there's a bug. Joshua Hill reccomended to go to openjailbreak.com and grab the version there, so I'll try that. Thank you for attempting to help me! Sent from my iPad On Sat, Apr 25, 2015 at 2:44 PM, Josh Max [email protected]
|
@awesomebing1 Sure thing... I hope that works! |
@joshumax You are correct, we never envisaged it being built on a powerpc platform :) |
This must be a PowerPC issue, as I compiled it on a Mac running Linux and it successfully uploaded. Though it did not install (should I open a new issue?). |
Yeah, probably wise to open a new issue, if I can help I will. Not sure any bugs will actually get fixed though. |
Since my gcc toolchain does not work, I have to use clang.
It does not allow the '-mthumb-interwork' option to be used, and errors out.
Will support for clang be added, or should I go find another gcc toolchain?
The text was updated successfully, but these errors were encountered: