Another Macro LLVM Error

OpenVMS x86 native compilers, cross compilers news and questions.
Post Reply
User avatar

Topic author
cct
Master
Posts: 255
Joined: Sat Aug 15, 2020 9:00 am
Reputation: 0
Location: Cambridge, UK
Status: Offline

Another Macro LLVM Error

Post by cct » Sat Dec 14, 2024 1:38 pm

XMAC V6.0-115 (GEM 50Y4T) on OpenVMS x86_64 V9.2-3

Getting the error in a few bits of Macro, for example:

$ macro FIND_SIZE.MAR
LLVM ERROR: non-zero initializer found in section 'FINDMAP$$VSI$$'

and of course no object produced.
I didn't get this under V9.2-2

Coe in question is:

Code: Select all

        .TITLE FIND_SIZE

        ;       F I N D _ S I Z E
        ;       -----------------
        ;
        ;       THIS ROUTINE RETURNS THE NUMBER OF BLOCKS ALLOCATED TO
        ;       THE SPECIFIED FILE.
        ;       IF ANY ERROR OCCURS OPENING THE FILE THIS ROUTINE RETURNS -1.
        ;
        ;--------------------------------------------------------------------

        .PSECT FINDMAP,LONG,PIC,OVR,GBL,SHR,NOEXE
FILE_FAB:                                       ; FILE ACCESS BLOCK FOR
        $FAB                                    ; GETTING ATTRIBUTES


        .PSECT $CODE,NOWRT,PIC,SHR,LONG
        .ENTRY FIND_SIZE,^M<R2,R3,R4>           ; SAVE REGISTERS 2,3 AND 4
        FIND_SIZE_FILE = 4                      ; POSITION IN PARAMERER LIST
                                                ; OF FILE NAME STRING

        MOVL    #-1,R3                          ; ASSUME ERROR

        MOVAL   @FIND_SIZE_FILE(AP),R2          ; MOVE ADDRESS OF STRING DESCRIPTOR
        MOVAL   @4(R2),R4                       ; NOW MOVE THE ADDRESS OF THE TEXT

        $FAB_STORE -                            ; MOVE VALUES INTO FAB
                FAB=FILE_FAB, -                 ; SPECIFY FAB ADDRESS
                FNA=(R4), -                     ; FILESPEC STRING ADDRESS
                FNS=(R2)                        ; FILESPEC STRING SIZE

        $OPEN   FAB=FILE_FAB                    ; OPEN THE FILE TO GET THE ATRIBUTES
        BLBC    R0,TIDY_UP                      ; WATCH OUT FOR ERRORS

        MOVL    FILE_FAB+FAB$L_ALQ,R3           ; GET ALLOCATED SIZE INTO R3
        BRB     TIDY_UP                         ; CLOSE FILE BEFORE EXIT

TIDY_UP:
        $CLOSE  FAB=FILE_FAB                    ; CLOSE THE FILE AFTERWARDS
        MOVL    R3,R0                           ; AND RETURN THE SIZE OR -1 IF ERROR
        RET

        .END
As I have said before, I know nothing about Macro code, so don't understand what this refers to, nor why the previous version didn't complain

Anybody any the wiser?
Chris Townley
VMS Ambassador


jreagan
VSI Expert
Master
Posts: 227
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: Another Macro LLVM Error

Post by jreagan » Sat Dec 14, 2024 2:57 pm

The PSECT FINDMAP is marked OVR. Essentially a Fortran COMMON block. The $FAB macro expands to having initializers. We are trying to determine if the ELF section should be marked NOBITS or not and got confused (if you don't know what I'm talking about, that's ok). I'll add it to our bug list but if you could raise a support case, that would be nice.

We'll see if we can resolve it for an update to V9.2-3.

John

User avatar

Topic author
cct
Master
Posts: 255
Joined: Sat Aug 15, 2020 9:00 am
Reputation: 0
Location: Cambridge, UK
Status: Offline

Re: Another Macro LLVM Error

Post by cct » Sat Dec 14, 2024 3:11 pm

Thanks for that. I look forward to another patch
Chris Townley
VMS Ambassador

User avatar

Topic author
cct
Master
Posts: 255
Joined: Sat Aug 15, 2020 9:00 am
Reputation: 0
Location: Cambridge, UK
Status: Offline

Re: Another Macro LLVM Error

Post by cct » Tue Dec 17, 2024 2:23 pm

Another result of this is that the MACRO returns a good status, and an invalid object is left.

SP 1 $ macr/list FIND_SIZE.MAR
LLVM ERROR: non-zero initializer found in section 'FINDMAP$$VSI$$'
SP 1 $ show symbol $STATUS
$STATUS == "%X00000001"

Is it possible in the case of an LLVM error that the calling compiler can return an error code?
Last edited by cct on Tue Dec 17, 2024 2:27 pm, edited 1 time in total.
Chris Townley
VMS Ambassador

Post Reply