X86 Macro compiler/LLVM error
-
Topic author - Master
- Posts: 193
- Joined: Sat Aug 15, 2020 9:00 am
- Reputation: 0
- Location: Cambridge, UK
- Status: Offline
X86 Macro compiler/LLVM error
Trying to compile some macro code that was ported from VAX to Alpha, and worked on I64, and 3 files are coming up with:
LLVM ERROR: invalid symbol redefinition
Not that I know diddly about macro, but what does this mean?
I have been looking at the latest Vax Macro reference manual and it doesn't reference LLVM at all. Are there any suitable references available?
Also is there any rule fo thumb for what command line to compile old macro on X86?
LLVM ERROR: invalid symbol redefinition
Not that I know diddly about macro, but what does this mean?
I have been looking at the latest Vax Macro reference manual and it doesn't reference LLVM at all. Are there any suitable references available?
Also is there any rule fo thumb for what command line to compile old macro on X86?
Last edited by cct on Mon Apr 01, 2024 3:34 pm, edited 2 times in total.
--
Chris
Chris
Re: X86 Macro compiler/LLVM error
Do you have a PSECT and a symbol with the same name? Something like:
Code: Select all
$ ty symsect.mar
.psect code, exe, nowrt
code: .call_entry
ret
.end code
$ macro symsect
LLVM ERROR: invalid symbol redefinition
$
Here, LLVM would create an ELF section with the name CODE and a symbol with the same name. And that's invalid in LLVM.
Out of the top of my head I don't know of any specific rule for compiling MACR32 sources. The only thing which comes to mind: explicitly use PSECTs and set EXE and NOWRT for code and NOEXE for data.
-
Topic author - Master
- Posts: 193
- Joined: Sat Aug 15, 2020 9:00 am
- Reputation: 0
- Location: Cambridge, UK
- Status: Offline
Re: X86 Macro compiler/LLVM error
Looks like I do:
Not sure what do do... AS I said I knoe dilly about macro (;
Code: Select all
$ ty BIG_CHARS.MAR
.TITLE BIG_CHARS
.IDENT /MAC.01/
.PSECT $CODE,NOWRT,PIC,SHR,LONG
.ENTRY BIG_CHARS,0
CLRL R0 ; DUMMY, IN CASE SOMEONE REALLY CALLS US
RET
.PSECT BIG_CHARS,LONG,NOPIC,OVR,REL,GBL,NOSHR,NOEXE,WRT,NOVEC
CHR_0: .ASCII \ @@@@@ \
.ASCII \ @@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@ \
.ASCII \ @@@@@ \
CHR_1: .ASCII \ @@@ \
.ASCII \ @@@@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@@@@@ \
.ASCII \ @@@@@@ \
CHR_2: .ASCII \ @@@@@ \
.ASCII \ @@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@@ \
.ASCII \ @@@@ \
.ASCII \ @@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
CHR_3: .ASCII \ @@@@@ \
.ASCII \ @@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@ @@\
.ASCII \ @@@@@@@ \
.ASCII \ @@@@@ \
CHR_4: .ASCII \ @@ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
CHR_5: .ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@ \
.ASCII \ @@@@@@@@ \
.ASCII \ @@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@ \
.ASCII \ @@@@@ \
CHR_6: .ASCII \ @@@@@@@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@ \
.ASCII \ @@@@@@@@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@ \
CHR_7: .ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
CHR_8: .ASCII \ @@@@@ \
.ASCII \ @@@@@@@ \
.ASCII \ @@ @@ \
.ASCII \ @@@@@ \
.ASCII \ @@ @@ \
.ASCII \ @@@ @@@\
.ASCII \ @@@@@@@ \
.ASCII \ @@@@@ \
CHR_9: .ASCII \ @@@@@ \
.ASCII \ @@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@\
.ASCII \ @@\
.ASCII \ @@ \
.ASCII \ @@@ \
CHR_A: .ASCII \ @@@@@ \
.ASCII \ @@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
CHR_B: .ASCII \ @@@@@@ \
.ASCII \ @@@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@ \
.ASCII \ @@ @@ \
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@ \
.ASCII \ @@@@@@@ \
CHR_C: .ASCII \ @@@@@@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@ \
CHR_D: .ASCII \ @@@@@@ \
.ASCII \ @@@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@ \
.ASCII \ @@@@@@@ \
CHR_E: .ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@ \
.ASCII \ @@@@@@ \
.ASCII \ @@@@@@ \
.ASCII \ @@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
CHR_F: .ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@ \
.ASCII \ @@@@@@ \
.ASCII \ @@@@@@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
CHR_G: .ASCII \ @@@@@@ \
.ASCII \ @@@@@@@@\
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ @@@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@\
.ASCII \ @@@@@@ \
CHR_H: .ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
CHR_I: .ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
CHR_J: .ASCII \ @@@@\
.ASCII \ @@@@\
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@@@@@@@ \
.ASCII \ @@@@@@ \
CHR_K: .ASCII \ @@ @@\
.ASCII \ @@ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@@@@@ \
.ASCII \ @@@@@@ \
.ASCII \ @@ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@ @@\
CHR_L: .ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
CHR_M: .ASCII \ @@ @@\
.ASCII \ @@@ @@@\
.ASCII \ @@ @@@ @@\
.ASCII \ @@ @@@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
CHR_N: .ASCII \ @@ @@\
.ASCII \ @@@ @@\
.ASCII \ @@@@ @@\
.ASCII \ @@ @@ @@\
.ASCII \ @@ @@ @@\
.ASCII \ @@ @@@@\
.ASCII \ @@ @@@\
.ASCII \ @@ @@\
CHR_O: .ASCII \ @@@@@ \
.ASCII \ @@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@ \
.ASCII \ @@@@@ \
CHR_P: .ASCII \ @@@@@@@ \
.ASCII \ @@@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@ \
.ASCII \ @@ \
.ASCII \ @@ \
.ASCII \ @@ \
CHR_Q: .ASCII \ @@@@@ \
.ASCII \ @@@@@@@ \
.ASCII \ @@ @@\
.ASCII \ @@ @@ @@\
.ASCII \ @@ @@ @@\
.ASCII \ @@ @@@@\
.ASCII \ @@@@@@@ \
.ASCII \ @@@@@ @\
CHR_R: .ASCII \ @@@@@@@@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@ \
.ASCII \ @@ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@ @@\
CHR_S: .ASCII \ @@@@@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@ \
.ASCII \ @@@@@@ \
.ASCII \ @@@@@@ \
.ASCII \ @@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@ \
CHR_T: .ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
CHR_U: .ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
CHR_V: .ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@@ \
CHR_W: .ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @ @@\
.ASCII \ @@ @@@ @@\
.ASCII \ @@@@ @@@@\
.ASCII \ @@ @@ \
CHR_X: .ASCII \ @@ @@\
.ASCII \ @@ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@ @@\
CHR_Y: .ASCII \ @@ @@\
.ASCII \ @@ @@\
.ASCII \ @@ @@ \
.ASCII \ @@ @@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
CHR_Z: .ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@ \
.ASCII \ @@@@@@@@@\
.ASCII \ @@@@@@@@@\
CHR_ : .ASCII \ \
.ASCII \ \
.ASCII \ \
.ASCII \ \
.ASCII \ \
.ASCII \ \
.ASCII \ \
.ASCII \ \
.END
--
Chris
Chris
Re: X86 Macro compiler/LLVM error
Change either the BIG_CHARS in the .ENTRY or in the .PSECT.
I would change the PSECT name, to something like THE_BIG_CHARS. I would check if there are other PSECTs named BIG_CHARS and rename them also to THE_BIG_CHARS - the shown PSECT has OVR attribute.
I would change the PSECT name, to something like THE_BIG_CHARS. I would check if there are other PSECTs named BIG_CHARS and rename them also to THE_BIG_CHARS - the shown PSECT has OVR attribute.
Re: X86 Macro compiler/LLVM error
We will be fixing XMACRO in the future to workaround the LLVM restriction. [This is one of my hot buttons. Don't get me started on their stupid restriction.]
-
Topic author - Master
- Posts: 193
- Joined: Sat Aug 15, 2020 9:00 am
- Reputation: 0
- Location: Cambridge, UK
- Status: Offline
-
- Master
- Posts: 475
- Joined: Fri Apr 17, 2020 7:31 pm
- Reputation: 0
- Location: Rhode Island, USA
- Status: Offline
- Contact:
Re: X86 Macro compiler/LLVM error
I would fix it anyway if it was me.
Same name in different namespaces are confusing. Better to avoid.
Same name in different namespaces are confusing. Better to avoid.
-
Topic author - Master
- Posts: 193
- Joined: Sat Aug 15, 2020 9:00 am
- Reputation: 0
- Location: Cambridge, UK
- Status: Offline
Re: X86 Macro compiler/LLVM error
I intend to, but I neeed to see how it is used. I imagine it is only referencing the psect, so I just change the .entry as you see
--
Chris
Chris
-
- Master
- Posts: 475
- Joined: Fri Apr 17, 2020 7:31 pm
- Reputation: 0
- Location: Rhode Island, USA
- Status: Offline
- Contact:
Re: X86 Macro compiler/LLVM error
Some languages are pretty forgiving in this regard.
The following is valid C#:
Namespace names, context dependent keywords and member names does not conflict. But it is definitely WTF code.
The following is valid C#:
Code: Select all
using System;
namespace dynamic
{
public class X
{
public static dynamic dynamic = 123;
}
}
namespace NS
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine(dynamic.X.dynamic);
Console.ReadKey();
}
}
}
Re: X86 Macro compiler/LLVM error
This may affect linking the application. The entry generates a symbol, which can be referenced (but may not be actually used) in another source module. The linker sees the reference and tries to resolve it. If the MACRO32 object module is in an object library, it usually will automatically be included by the linker. If that's the case and if you change the entry name, you need to manually include the object module. If you change the PSECT name (or names), it has no effect on linking the application.