Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Because GCC is in C++ and has a monolithic architecture. Of course this gives insane compile times and build resource requirements.
If you're targeting Android, you could just use Google's ready-made NDK, based on LLVM. -
Parzi88336y@Fast-Nop i'm trying to compile a single C file and NDK is a bitch to get set up on Debian because you have to manually set everything up, it's basically a "here's the binaries, you fucking figure it out" when installed through apt.
also I have 4GB RAM and all 32GB Swap free when it segfaults, so it's using 3.7GB or so and segfaulting. Smells like a 32-bit RAM boundary, but it's an AMD64 toolchain building the toolchain, so... -
@Parzi dunno about Debian, but getting the NDK up and running under Windows is pretty easy. You have to "generate" your NDK anyway using the make_standalone_toolchain.py script. The NDK as downloaded won't compile stuff directly.
-
Because segfaults aren't caused by lack of memory. They can be, but they're illegal memory accesses.
Are you using a makefile? Or just kinda winging it? There's probably a compiler option you're missing. -
Parzi88336y@deadPix3l Buildroot. I'm using Buildroot.
i'm a fucking plebian
oheeeeey it finished while i was typing this
FUCKING FINALLY -
CurtisMJ4686y*could* be memory corruption. I saw the linaro toolchains legit segfault a couple times though so I don't know anymore lol. Usually you can trust the compiler.
-
ltlian21966yHaving trouble seeing what any of this has to do with segfaults. You can produce a segfault with a couple of lines of code.
-
Wrong libs' versions, faulty DIMM, faulty SSD/HDD, faulty lib files, etc etc. Afaik lack of memory itself does not cause sigsegv - it just gives you a malloc error saying it could not allocate requested memory.
C devs, correct me if I'm wrong. -
@netikras I could be wrong but I believe if you try to allocate too much memory, it fails, sets errno, and returns a null pointer. Now if you fail to check errno and try to dereference that pointer anyways, there's your segfault.
I haven't done C in a long time, and I've never tried to allocate enough to trigger that. So grain of salt. But I think so.
Related Rants
>compiling a toolchain for my phone
>compiling gcc
>segfault
wtf, i have like 8GB RAM and 32GB Swap on an SSD
>rerun make w/o clean
>continues, no segfault
ok?
>segfault a few minutes later
FUCK
rinse and repeat like 30 times
why
rant
segfault
compile
gcc
why