Bug 32738 - undefined reference to __ia64_syscall
Summary: undefined reference to __ia64_syscall
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc   
(Show other bugs)
Version: 7.3
Hardware: ia64 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Aaron Brown
Depends On:
TreeView+ depends on / blocked
Reported: 2001-03-22 20:08 UTC by Richard Offer
Modified: 2016-11-24 14:48 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-23 03:24:08 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Richard Offer 2001-03-22 20:08:20 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.2.15-3SGI_39 i686)

Looks like __ia64_syscall is not being exported from libc ?

On Fisher.
# objdump -t libc.so.6.1 | grep  __ia64_syscall
0000000000036e60 l     F .text  0000000000000000   __ia64_syscall

Reproducible: Always
Steps to Reproduce:
Compile any code that defines its own system calls, in the example below I
define a new syscall _getpid() to illistrate the problem (_syscall0 was
copied from asm/unistd.h and then a leading _## was added to name), this
code works on Turbo Linux.

#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
#include <asm/types.h>
#include <asm/unistd.h>

#define _syscall0(type,name)                        \
type                                    \
_##name (void)                             \
{                                   \
    register long dummy1 __asm__ ("out0");              \
    register long dummy2 __asm__ ("out1");              \
    register long dummy3 __asm__ ("out2");              \
    register long dummy4 __asm__ ("out3");              \
    register long dummy5 __asm__ ("out4");              \
    return __ia64_syscall(dummy1, dummy2, dummy3, dummy4, dummy5,   \
                  __NR_##name);             \

static _syscall0(pid_t,getpid)

main(int argc, char **argv)

    printf("getpid() = %d\n",getpid());
    printf("getpid() = %d\n",_getpid());

    return 0;

# gcc -v -o syscall syscall.c
Reading specs from
gcc version 2.96-ia64-000717 snap 001117
 /usr/lib/gcc-lib/ia64-redhat-linux/2.96-ia64-000717/cpp -lang-c -v
-D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ia64
-D__ia64__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix -D__LP64__
-D__ELF__ -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -D__linux__
-D__unix__ -D__LP64__ -D__ELF__ -D__linux -D__unix -Asystem(linux)
-Acpu(ia64) -Amachine(ia64) -D__LONG_MAX__=9223372036854775807L syscall.c
GNU CPP version 2.96-ia64-000717 snap 001117 (cpplib)
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
syscall.c:12:18: warning: "_syscall0" redefined
/usr/include/asm/unistd.h:212:1: warning: this is the location of the
previous definition
 /usr/lib/gcc-lib/ia64-redhat-linux/2.96-ia64-000717/cc1 /tmp/cc97Wx11.i
-mb-step -quiet -dumpbase syscall.c -version -o /tmp/cco8GnjW.s
GNU C version 2.96-ia64-000717 snap 001117 (ia64-redhat-linux) compiled by
GNU C version 2.96-ia64-000717 snap 001117.

-x -o /tmp/cc35CB8X.o /tmp/cco8GnjW.s
-dynamic-linker /lib/ld-linux-ia64.so.2 -o syscall
/tmp/cc35CB8X.o -lgcc -lc -lgcc
/tmp/cc35CB8X.o: In function `_getpid':
/tmp/cc35CB8X.o(.text+0x22): undefined reference to `__ia64_syscall'
collect2: ld returned 1 exit status

Comment 1 Bill Nottingham 2001-03-23 01:38:21 UTC
__ia64_syscall doesn't exist. Don't use the syscallX() macros.

Use syscall() instead, for example:

syscall(SYS_syslog,8,NULL,<some level>),

Comment 2 Richard Offer 2001-03-23 03:24:00 UTC
If __ia64_syscall doesn't exist why is it in /usr/include/asm/unistd.h ?

More importantly why does the both the original code any my cut down example 
work under Turbo Linux 6.1 (IA64 edition) ?

I've looked in the turbo glibc and I can see the difference, you're not
exporting __ia64_syscall in the sysdeps/unix/sysv/linux/ia64/Versions file.

Comment 3 Bill Nottingham 2001-03-23 04:08:32 UTC
The glibc maintainers decided it should not be exported.

Note You need to log in before you can comment on or make changes to this bug.