3 ms·
On mainstream native platforms, Ada programs no longer require the stack to be made executable in order to run properly. What does that even mean? I'm dabbling
by Keyframe 10y ago
On mainstream native platforms, Ada programs no longer require the stack to be made executable in order to run properly.
What does that even mean? I'm dabbling with Ada as of recently.
Also, woo!
Support for the RISC-V instruction set has been added.
On topic, I'm using GCC5 and 6 as well as experimenting with 7, and I also have Clang - all available to me via switch/simple shell functions. I always tend to have my junk work on all of those, so am in a kind of a simplistic position to compare each. From a daily user perspective, there's not much difference at all (clang and newer gcc). Clang's pretty warnings are almost in GCC now as well, speed is still on GCC's side (for me at least) and all is good in GCC and LLVM land. I'm leaning more towards GCC since I've been using it since it became united in late 90s. I believed in it, even though people thought of it, at the time, to be slow and shit. Look at it now! I'm using it on MacOS (yes), Windows and Linux. I'm sure more heavyweight users will find a lot of things GCC can improve upon though.
I know it might not be strictly in the scope of GCC's domain, but I would like to see some static analysis and linters (like MISRA, etc.) included out of the box with it. That would be swell.
- __s 10y agohttp://stackoverflow.com/questions/34982151/executable-ada-code-on-the-stack http://stackoverflow.com/questions/34982151/executable-ada-c...
- Kenji 10y ago>What does that even mean? I know nothing about Ada but there is a feature called called 'executable bit' in pretty much all desktop processors since 1-2 decades. What this bit does is it marks certain regions of memory as not executable, i.e. you're not allowed to put the instruction pointer onto that region and let the CPU run the instructions. This is a hardware-level feature and can be disabled in BIOS/UEFI. Usually the stack is marked as not executable as a security feature, so buffer overruns can't just write code on the stack and then it is executed. Why Ada needed this disabled is beyond me. Does it execute things on the stack?
- dom0 10y agoAs usual, no-execute bits in the page table is something that trickles down. I think in x86 land AMD introduced it with AMD64. The RISCies (Sparc, Power, Alpha, hppa) had this earlier.
- xyz6633 10y ago>Why Ada needed this disabled is beyond me. Does it execute things on the stack? I believe this is due to nested function support. There is some explanation here: https://stackoverflow.com/questions/34982151/executable-ada-code-on-the-stack https://stackoverflow.com/questions/34982151/executable-ada-...
- Sanddancer 10y agoThe static analysis stuff is something that is in clang's favor. Because of its architecture, static analysis is included, and can be run at compile time through a wrapper called scan-build [1]. So, to get static analysis, most of the time, you just have to run "scan-build make" and it'll do things for you. Clang's clang-tidy tool also handles linting as well, with a misra plugin too [2]. That's the big advantage I see with clang, is that its architecture makes a lot of these things a lot easier to add, which is an area that gcc is just barely starting to address. [1] https://clang-analyzer.llvm.org/scan-build.html https://clang-analyzer.llvm.org/scan-build.html [2] https://github.com/rettichschnidi/clang-tidy-misra https://github.com/rettichschnidi/clang-tidy-misra