Skip to content

Compiling C inline powerpc 64-bit architecture assembly code with Clang 14.0.0 compiler, error: Undefined temporary symbol .Ltmp2 #93192

@bethebset

Description

@bethebset

My source code are:
int MyOpen(char * filename,int Attrib)
{//__NR_open
//return syscall(SCN(1024), filename, Attrib, 0777);
int fp;
asm volatile (
"li 0, 1024\n"
"mr 3, %1\n"
"mr 4, %2\n"
"sc\n"
"mr %0, 3\n"
:"=r"(fp)
:"r" (filename),"r" (Attrib)
:"memory"
);
return fp;
}

int main()
{
int fin = MyOpen("/home/test/hello.c",O_RDONLY );
return 0;
}
compile with:
clang -m64 -target powerpc64-linux-gnu test.c -o test
and get ERROR:
error: Undefined temporary symbol .Ltmp2
2 warnings and 1 error generated.

On Ubuntu 22.04
Have a powerpc64 cross-compile environment

I'm a rookie and didn't find a good fit on google to solve the problem, please help me!

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:PowerPCclangClang issues not falling into any other categoryobsoleteIssues with old (unsupported) versions of LLVM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions