简体   繁体   中英

unknown type name '__uint64_t'

I have recovered old developments, (embedding proC) that do not compile anymore following a migration (oracle 11g to 12c).

Note: The data has been anonymised.

Old environment:

Linux <NOMDELAMACHINE> 2.6.32-642.el6.x86_64 #1 SMP Wed Apr 13 00:51:26 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
Oracle 11g 
gcc : 
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright © 2010 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a PAS GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

New environment:

Linux <NOMDELAMACHINE> 3.10.0-693.17.1.el7.x86_64 #1 SMP Sun Jan 14 10:36:03 EST 2018 x86_64 x86_64 x86_64 GNU/Linux
Oracle 12c
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
Copyright © 2015 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a PAS GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

In the old environment, when we compile, there are no problems.

On the other hand, when we compile on the new environment, we get the following problem:

In file included from /usr/include/signal.h:340:0, 
                 from /usr/include/sys/wait.h:30, 
                 from /tmp/compilC/inc/LIBPERSO.h:39, 
                 from FichierC.c:27:

/usr/include/bits/sigcontext.h:33:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t xstate_bv; 
   ^ 
/usr/include/bits/sigcontext.h:177:3: erreur: unknown type name ‘__uint64_t’ 
   __uint64_t xstate_bv; 
   ^ 
/usr/include/bits/sigcontext.h:178:3: erreur: unknown type name ‘__uint64_t’ 
   __uint64_t reserved1[2]; 
   ^ 
/usr/include/bits/sigcontext.h:179:3: erreur: unknown type name ‘__uint64_t’ 
   __uint64_t reserved2[5];    ^

make: *** [FichierC] Erreur 1

I compared the sigcontext of both environments and actually, I do not have the same installed:

old enviro sigcontext:

struct sigcontext

{

  unsigned short gs, __gsh;

  unsigned short fs, __fsh;

  unsigned short es, __esh;

  unsigned short ds, __dsh;

  unsigned long edi;

  unsigned long esi;

  unsigned long ebp;

  unsigned long esp;

  unsigned long ebx;

  unsigned long edx;

  unsigned long ecx;

  unsigned long eax;

  unsigned long trapno;

  unsigned long err;

  unsigned long eip;

  unsigned short cs, __csh;

  unsigned long eflags;

  unsigned long esp_at_signal;

  unsigned short ss, __ssh;

  struct _fpstate * fpstate;

  unsigned long oldmask;

  unsigned long cr2;

};

sigcontext new enviro :

struct sigcontext

{

  __uint64_t r8;

  __uint64_t r9;

  __uint64_t r10;

  __uint64_t r11;

  __uint64_t r12;

  __uint64_t r13;

  __uint64_t r14;

  __uint64_t r15;

  __uint64_t rdi;

  __uint64_t rsi;

  __uint64_t rbp;

  __uint64_t rbx;

  __uint64_t rdx;

  __uint64_t rax;

  __uint64_t rcx;

  __uint64_t rsp;

  __uint64_t rip;

  __uint64_t eflags;

  unsigned short cs;

  unsigned short gs;

  unsigned short fs;

  unsigned short __pad0;

  __uint64_t err;

  __uint64_t trapno;

  __uint64_t oldmask;

  __uint64_t cr2;

  __extension__ union

    {

      struct _fpstate * fpstate;

      __uint64_t __fpstate_word;

    };

  __uint64_t __reserved1 [8];

};

The make file used for compilation:

CC=gcc    

# Repertoire des fichiers include ".h"     
# ------------------------------------

INCDIR=/tmp/compilC/inc     
INCDIRBADS=/tmp/compilC/inc     
SRCDIR=/tmp/compilC     
OBJDIR=$(SRCDIR)/obj    

ECHO=$(ORACLE_HOME)/bin/echodo

CFLAGS=-I$(INCDIR) -I$(INCDIRBADS) -I$(ORACLE_HOME)/precomp/public -DPRECOMP -Dextension -undef -O3 -Wall -v 


# Fichiers de declarations ".h" a inclure     
# ---------------------------------------     
INC=\

 $(INCDIR)/header1.h\     
 $(INCDIR)/header2.h\     
 $(INCDIR)/header3.h\     
 $(INCDIR)/header4.h\     
 $(INCDIR)/header5.h\     
 $(INCDIR)/header6.h\     
 $(INCDIR)/header7.h\     
 $(INCDIR)/header8.h\     
 $(INCDIR)/header9.h

all: FichierC

# FichierC.o     
# ---------

$(OBJDIR)/FichierC.o:\     
   $(SRCDIR)/FichierC.c $(INC)     
    @$(ECHO) $(CC) $(CFLAGS) -o $@ -c $(SRCDIR)/FichierC.c

Currently, I do not know how to orient my research.

I would say that the problem comes from the version of the library that is installed incorrectly but I'm not sure and being the master of the environment (root account) I can not do the actions I want to test.

Do you have any leads / ideas to unlock me?

Can I recover the library "sigcontext.h" and embed it in the project at the address of my INCDIR?

UPDATE == I updated my code to more anonymous, so i can i give you more :

Make :

In file included from /usr/include/signal.h:340:0,
                 from /usr/include/sys/wait.h:30,
                 from FichierC.c:8:
/usr/include/bits/sigcontext.h:33:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t xstate_bv;   ^
/usr/include/bits/sigcontext.h:177:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t xstate_bv;   ^
/usr/include/bits/sigcontext.h:178:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t reserved1[2];   ^
/usr/include/bits/sigcontext.h:179:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t reserved2[5];   ^
FichierC.c: In function ‘test’:
FichierC.c:20:4: attention : cette fonction retourne l'adresse d'une variable locale [-Wreturn-local-addr]
    return(ach_DateHeure);    ^
make: *** [FichierC] Erreur 1

FichierC :

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <signal.h>
#include <inttypes.h>
#include <stdint.h>

char ach_DateHeure[500] = {' '};

char *test(void)
{ 
    char ach_DateHeure[500] = {'0'};

   return(ach_DateHeure);
}

So the problem is on line

#include <sys/wait.h>

So on my machine, __uint64_t (with the leading underscores) is defined only in /usr/include/x86_64-linux-gnu/bits/types.h

And is used only in /usr/include/x86_64-linux-gnu/bits/* (including sigcontext.h) and /usr/include/x86_64-linux-gnu/sys/*

/usr/include/signal.h includes:

#include <bits/types.h>
#include <bits/signum.h>

then much later:

/* Get machine-dependent `struct sigcontext' and signal subcodes.  */
# include <bits/sigcontext.h>

These are the places I suggest to check for a library inconsistency.

Also check your code is not including directly?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM