Author Topic: Code::Blocks converting Linker options mentioned in a txt file to whole command  (Read 667 times)

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1519
ok, i re read all your post and i have a few questions:
1) What is in the NetStack_Data\CB\release\release-NuNet\ObjPathFile.txt file and how is it created?
2) Where is this file? relative to the project file?
3) Can you tell us more about your build process?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5943
    • My Best Post
Note: The compiler website implies the compiler is only for 32 bit windows OS.

Post the Operating System (OS) for both working and not working setups.

Also, post the full CB version info for both working and not working setups.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5943
    • My Best Post
Also, post the path to the CB Project file for both working and non working setups.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline srikanthsivasai

  • Multiple posting newcomer
  • *
  • Posts: 12
Operating system OS for both working / non-working setups.
Windows 2008 R2 Standard 64-bit.
I have attached snippets of the CB version for both working / non-working servers.
The path to the CB project is relative & is existing where the below command is executing for both working / non-working setups
Entering directory 'C:\..........\NetStack'
Execution of 'armar.exe -r -s ..\output\NetStack-sim-NuNet.a.......' failed.


Please let me know if you need any more information regarding the same.

Thank you,
Sri

Offline srikanthsivasai

  • Multiple posting newcomer
  • *
  • Posts: 12

@Bluehazzard

1) What is in the NetStack_Data\CB\release\release-NuNet\ObjPathFile.txt file and how is it created?
This file is having the paths for object files. This is being created as the full command armar.exe -r -s ..\output\NetStack-sim-NuNet.a along with the object files in the command line is failing, as the characters are exceeding the 8191 limit. Hence all the files are being passed as txt file.
2) Where is this file? relative to the project file? Yes it is present in the above mentioned dir and the dir starts from the path where CBP file is residing.
3) Can you tell us more about your build process?
I have attached the CB Project file for your reference. Please let me know if you need any more information regarding the same.

I cannot attach fulle build log, as its exceeding the limit set for the size of the attachments in this forum.

Thank you,
Sri

Offline srikanthsivasai

  • Multiple posting newcomer
  • *
  • Posts: 12
Working & non-working build logs attached.

Thank you,
Sri

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5943
    • My Best Post
Ask the person who built the cb 10.05 what changes they did to the source code.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5943
    • My Best Post
I strongly suggest if the person who customized the CB 10.05 build has left the company that you make a backup of the CB 10.05 programs and config files. And, then move them to the non-working computer.

It is either that or pay someone a lot of money to fix the problem.

Edit2: You might also try finding a version of software from http://www.emblocks.org because while your modified CB 10.05 does not look like that. It is the closest fork of CB that I know of based on your toolchain setting screen you posted.
Note: The www.emblocks.org no longer exists; so, it might be hard to find a copy unless you use the wayback machine.

Tim S.
« Last Edit: October 09, 2017, 08:04:13 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1519
Hi, i now understand your problem...
Sadly i don't see a easy solution. There are multiple problems we have to solve.
As stahta01 mentioned your old codeblocks version is not a normal codeblocks, but a fork. We have no information about how this fork works so we can not apply this in "normal" codeblocks.
I also do not understand how this fork distinguishes between when he should use the  "--via" text file and when the internal object file lists.

"Our" codeblocks version always puts the object files to the "ar" command so the command line gets to long, also when you use the via command. If you remove the object file list from the command obviously normal compiling will not work.

Lets try to find a solution:
1) The command line to the linker is to long, so lets try to shorten it:
Solution:
In the project file you provided there are ca 800 files. The mean filename length is 8 characters so it should be possible to limit the object file length to a length so that the command line does not exceed the windows limit. You can shorten the object output folder path to something like
Code: [Select]
.o\$(PROJECT_NAME)\ in Project->Properties->Build targets->Objects output dir
this should reduce the file length. With this you do not need the --via command line
Problems:
This solution is not quite problem resistant. Add some files and your build process is broken again...

2) Use always the --via command:
As stahta01 showed in your post use this command in the advanced compiler options
Code: [Select]
cmd /c if exist $static_output del $static_output
$lib_linker -r -s $static_output $link_options
but now you have to generate a text file with object files for all your projects.
2.1) A intermediate way would be to use a different compiler for the targets with many object files and the normal options for "short" projects
2.2) You can generate the object file list with codeblocks scripting so this all can be made quite transparent


3) Use makefiles for all this and use a custom makefile project

PS. How do you generate this text file with the object files? From hand?

Offline srikanthsivasai

  • Multiple posting newcomer
  • *
  • Posts: 12
@bluehazzard & @stahta01 you are exactly right. This is a forked version and not a full exe. It looks like all the builds have been designed in view of how this forked version reacts to certain commands. So I had to uninstall the latest version and copy back the old version to make this one working.

I really appreciate all your time & patience in figuring out the root cause for the issue. Thanks a lot.

Thank you,
Sri