Author Topic: PATCH: CB, compiler flags (new ones and improved handling) and possible crash  (Read 9057 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10404
@White-Tiger:

0. Linker options should be set in the linker tab
1. Same here. We have a separate tab for linker options, because linking is a special, important and very confusing step of the compilation process.
2. We can have "Pass the -O option to the linker" option and be done with it.
3. Can you list them?
4 (p.s.). It was a hack back then... now we'll have to revert it. Are you willing to provide a better patch? One that makes it possible to have a choice control.
5 (p.p.s.). LTO is for advanced users, really! Otherwise it would have been on by default. It is for people who know what is undefined behaviour and how to track and fix any occurrence exposed by LTO. Or are prepared to track compiler bugs.
<debugger plugin maintainer>
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline White-Tiger

  • Multiple posting newcomer
  • *
  • Posts: 83
hmm... somehow I missed the last two topic replies.

So to answer 3): I've mentioned the linker-only "Strip all symbols from binary" option before; http://forums.codeblocks.org/index.php/topic,19008.msg130055.html#msg130055
- lots in options_mw.xml

Then for mixed compiler/linker options:
- Profile code when executed
- (clang) Use AddressSanitizer, a memory error detector
- (clang) Use ThreadSanitizer, a data race detector
- (MSVC) Produce debugging symbols
- lots in options_mw.xml and others
Windoze 8.1 x86_64 16GiB RAM, wxWidgets-2.8x (latest,trunk), MinGW-builds (latest, posix-threads)
Code::Blocks (x86 , latest , selection length patch , build option fixes/additions , toggle comments)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10404
- (clang) Use AddressSanitizer, a memory error detector
- (clang) Use ThreadSanitizer, a data race detector
These are not linker options. They should be passed to both compiler and linker.

Still the feature is pretty broken at the moment. Any plans to improve it?
For me the path forward for cb and the c++ community in general is using cmake+ninja, so I don't intend to spend too much time on the internal build system.
For the record, cmake is not a good technology IMO, but it is better than the internal build system and the c++ community seems to converge around it.
<debugger plugin maintainer>
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline White-Tiger

  • Multiple posting newcomer
  • *
  • Posts: 83
- (clang) Use AddressSanitizer, a memory error detector
- (clang) Use ThreadSanitizer, a data race detector
These are not linker options. They should be passed to both compiler and linker.
[...]
well yeah.. that's what I said in my post above... but so is -flto which can be further configured with -O# options.
Which is why one can't split them... compiler and linker have to work together, thus one place to configure them.


Currently, I have no plans to change any of it, especially since I don't know how it could be improved (which is what this "topic" is about now)... or how much work it would be to add drop-downs to compiler options... I'm not a wxWidgets guy.

About the build system... well I don't care much as long as the IDE is fully controlling it without having to write build files myself. And of course having the IDE to display build errors, being able to cancel it and stuff like that.
Automatically generating "make" files would be a nice addition as people with a different IDE or non at all are also able to build the project. I never liked CMake but if Code::Blocks includes it and manages it without any further user interaction, why not...
« Last Edit: October 31, 2017, 10:28:01 am by White-Tiger »
Windoze 8.1 x86_64 16GiB RAM, wxWidgets-2.8x (latest,trunk), MinGW-builds (latest, posix-threads)
Code::Blocks (x86 , latest , selection length patch , build option fixes/additions , toggle comments)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10404
I never liked CMake but if Code::Blocks includes it and manages it without any further user interaction, why not...
You can use cmake to create cbp files and they build. Running and debugging is not 100% ironed out...
And you'll have to write cmake files by hand. There is no way for this step to be skipped.
<debugger plugin maintainer>
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]