Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » No flags on BRC compilation
No flags on BRC compilation [message #59339] Sat, 17 December 2022 20:34 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Hi,

I'm trying to cross-compile an application using CLANG compiler in linux (Ubuntu 22.04) for windows.
I'm using "-target x86_64-pc-win32" flag, among others.
All ok besides BRC files which don't get the flags.

For example, I added a C file to my application, and it compiles correctly :
clang -c ... -DflagSHARED  -fexceptions -target x86_64-pc-win32 -nostdinc -Wall -O3 -ffunction-sections -fdata-sections -x c -target x86_64-pc-win32 "/home/massimo/.config/u++/theide/UppHub/DXF/DXF/stoka.c"  -o "/home/massimo/sources_TOOLS/UPP_OUT/TimberStruct/DXF/CLANG_W64.Gui.Mt.Protect.Shared.Win32/stoka.c.o"


but the BRC not:
clang -c ... -DflagSHARED -c -o "/home/massimo/sources_TOOLS/UPP_OUT/TimberStruct/DXF/CLANG_W64.Gui.Mt.Protect.Shared.Win32/dxf.brc$brc.o" -x c "/home/massimo/sources_TOOLS/UPP_OUT/TimberStruct/DXF/CLANG_W64.Gui.Mt.Protect.Shared.Win32/dxf.brc$brc.c"


You can see the result dumping obj file headers; here a correct file:
Header.o:     formato del file pe-x86-64
architettura: i386:x86-64, flag 0x0000003d:
HAS_RELOC, HAS_LINENO, HAS_DEBUG, HAS_SYMS, HAS_LOCALS
indirizzo di partenza 0x0000000000000000


and here the wrong one, which gets wrong file format:
dxf.brc$brc.o:     formato del file elf64-x86-64
architettura: i386:x86-64, flag 0x00000011:
HAS_RELOC, HAS_SYMS
indirizzo di partenza 0x0000000000000000


Ciao

Massimo
Re: No flags on BRC compilation [message #59341 is a reply to message #59339] Sat, 17 December 2022 22:27 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
By now solved with a bash script 'myclang' :

#!/bin/bash
/usr/bin/clang -target x86_64-pc-win32 -fuse-ld=lld $@


and removing corresponding flags from builder.
Clang complains also about some other stuffs which are meaningless in windows code (-s flag, gc-sections) but they're just warnings.

I think that cross-compiling on linux for windows and maybe for os-x should get a tutorial on docs... it's a very useful stuff.

Ciao

Massimo
Previous Topic: Compilation Error of Custom Package
Next Topic: how to add compiler
Goto Forum:
  


Current Time: Fri Apr 19 07:50:17 CEST 2024

Total time taken to generate the page: 0.04484 seconds