GCC On IRIX -- a lot of stuff I'm learning about this
#41
RE: GCC On IRIX -- a lot of stuff I'm learning about this
In file included from /usr/include/internal/stdlib_core.h:34:0,
from /usr/include/stdlib.h:4,
from /root/build-4.8/mips-sgi-irix6.5/libstdc++-v3/include/cstdlib:72,
from ../../../../gcc-4.8.5/libstdc++-v3/libsupc++/atexit_thread.cc:25:
/usr/include/internal/stdlib_core.h:171:55: error: conflicting declaration 'char** restrict'
extern double strtod(const char * __restrict, char ** __restrict);
^
/usr/include/internal/stdlib_core.h:171:35: error: 'restrict' has a previous declaration as 'const char* restrict'
extern double strtod(const char * __restrict, char ** __restrict);
^
/usr/include/internal/stdlib_core.h:173:54: error: conflicting declaration 'char** restrict'
extern float strtof(const char * __restrict, char ** __restrict);
^
/usr/include/internal/stdlib_core.h:173:34: error: 'restrict' has a previous declaration as 'const char* restrict'
extern float strtof(const char * __restrict, char ** __restrict);
^
/usr/include/internal/stdlib_core.h:179:61: error: conflicting declaration 'char** restrict'
extern long double strtold(const char * __restrict, char ** __restrict);
^
/usr/include/internal/stdlib_core.h:179:41: error: 'restrict' has a previous declaration as 'const char* restrict'
extern long double strtold(const char * __restrict, char ** __restrict);
^
/usr/include/internal/stdlib_core.h:182:57: error: conflicting declaration 'char** restrict'
extern long int strtol(const char * __restrict, char ** __restrict, int);
^
/usr/include/internal/stdlib_core.h:182:37: error: 'restrict' has a previous declaration as 'const char* restrict'
extern long int strtol(const char * __restrict, char ** __restrict, int);
^
/usr/include/internal/stdlib_core.h:184:59: error: conflicting declaration 'char** restrict'
extern long long strtoll(const char * __restrict, char ** __restrict, int);
^
/usr/include/internal/stdlib_core.h:184:39: error: 'restrict' has a previous declaration as 'const char* restrict'
extern long long strtoll(const char * __restrict, char ** __restrict, int);
^
/usr/include/internal/stdlib_core.h:186:67: error: conflicting declaration 'char** restrict'
extern unsigned long int strtoul(const char * __restrict, char ** __restrict, int);
^
/usr/include/internal/stdlib_core.h:186:47: error: 'restrict' has a previous declaration as 'const char* restrict'
extern unsigned long int strtoul(const char * __restrict, char ** __restrict, int);
^
/usr/include/internal/stdlib_core.h:189:69: error: conflicting declaration 'char** restrict'
extern unsigned long long strtoull(const char * __restrict, char ** __restrict, int);
^
/usr/include/internal/stdlib_core.h:189:49: error: 'restrict' has a previous declaration as 'const char* restrict'
extern unsigned long long strtoull(const char * __restrict, char ** __restrict, int);
^
/usr/include/internal/stdlib_core.h:280:54: error: conflicting declaration 'const char* restrict'
extern int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/stdlib_core.h:280:29: error: 'restrict' has a previous declaration as 'wchar_t* restrict'
extern int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/stdlib_core.h:286:59: error: conflicting declaration 'const char* restrict'
extern size_t mbstowcs(wchar_t * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/stdlib_core.h:286:34: error: 'restrict' has a previous declaration as 'wchar_t* restrict'
extern size_t mbstowcs(wchar_t * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/stdlib_core.h:288:59: error: conflicting declaration 'const wchar_t* restrict'
extern size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
^
/usr/include/internal/stdlib_core.h:288:31: error: 'restrict' has a previous declaration as 'char* restrict'
extern size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
^
/usr/include/internal/string_core.h:61:53: error: conflicting declaration 'const void* restrict'
extern void *memcpy(void * __restrict, const void * __restrict, size_t);
^
/usr/include/internal/string_core.h:61:28: error: 'restrict' has a previous declaration as 'void* restrict'
extern void *memcpy(void * __restrict, const void * __restrict, size_t);
^
/usr/include/internal/string_core.h:63:53: error: conflicting declaration 'const char* restrict'
extern char *strcpy(char * __restrict, const char * __restrict);
^
/usr/include/internal/string_core.h:63:28: error: 'restrict' has a previous declaration as 'char* restrict'
extern char *strcpy(char * __restrict, const char * __restrict);
^
/usr/include/internal/string_core.h:64:54: error: conflicting declaration 'const char* restrict'
extern char *strncpy(char * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/string_core.h:64:29: error: 'restrict' has a previous declaration as 'char* restrict'
extern char *strncpy(char * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/string_core.h:68:53: error: conflicting declaration 'const char* restrict'
extern char *strcat(char * __restrict, const char * __restrict);
^
/usr/include/internal/string_core.h:68:28: error: 'restrict' has a previous declaration as 'char* restrict'
extern char *strcat(char * __restrict, const char * __restrict);
^
/usr/include/internal/string_core.h:69:54: error: conflicting declaration 'const char* restrict'
extern char *strncat(char * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/string_core.h:69:29: error: 'restrict' has a previous declaration as 'char* restrict'
extern char *strncat(char * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/string_core.h:78:55: error: conflicting declaration 'const char* restrict'
extern size_t strxfrm(char * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/string_core.h:78:30: error: 'restrict' has a previous declaration as 'char* restrict'
extern size_t strxfrm(char * __restrict, const char * __restrict, size_t);
^
/usr/include/internal/string_core.h:97:53: error: conflicting declaration 'const char* restrict'
extern char *strtok(char * __restrict, const char * __restrict);
^
/usr/include/internal/string_core.h:97:28: error: 'restrict' has a previous declaration as 'char* restrict'
extern char *strtok(char * __restrict, const char * __restrict);
^
/usr/include/internal/time_core.h:144:64: error: conflicting declaration 'const char* restrict'
extern size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict);
^
/usr/include/internal/time_core.h:144:31: error: 'restrict' has a previous declaration as 'char* restrict'
extern size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict);
^
/usr/include/internal/time_core.h:144:94: error: conflicting declaration 'const tm* restrict'
extern size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict);
^
/usr/include/internal/time_core.h:144:31: error: 'restrict' has a previous declaration as 'char* restrict'
extern size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict);


New error. I assume it's not supposed to be including this header in libstdc++v3 or something? how do I exclude it?

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-19-2024, 06:36 PM
#42
RE: GCC On IRIX -- a lot of stuff I'm learning about this
The code being processed (the top line "stdlib_core.h") is written using a storage class keyword called "__restrict" with two underscores. Before the adoption of C99, if you wanted to use the "restrict" keyword, you had to use the implementation-defined version that has the underscores. Code written to C99 does not use the underscores.
The purpose of the restrict keyword is to stop pointer aliasing for better performance.
What is happening is that somewhere there is a macro
#define __restrict restrict
that is supposed to make pre-C99 code compatible with a C99 compiler. But the code is not being compiled with C99, so restrict isn't being recognized as a keyword. In pre-C99 compilers, the macro above is incorrect.

Personaliris O2 Indigo2 R10000/IMPACT Indigo2 R10000/IMPACT Indigo2 Indy   (past: 4D70GT)
robespierre
refector peritus

Trade Count: (0)
Posts: 640
Threads: 3
Joined: Nov 2020
Location: Massholium
Find Reply
12-19-2024, 07:03 PM
#43
RE: GCC On IRIX -- a lot of stuff I'm learning about this
(12-19-2024, 05:40 PM)Raion Wrote:  It's like trying to pick the contaminants in a line of speed out of your nose after snorting it. There's a lot of blood and screaming.

(Not that I have experience with doing speed)

That's one hell of an analogy... Tongue

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,245
Threads: 41
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
12-19-2024, 07:47 PM
#44
RE: GCC On IRIX -- a lot of stuff I'm learning about this
(12-19-2024, 07:03 PM)robespierre Wrote:  The code being processed (the top line "stdlib_core.h") is written using a storage class keyword called "__restrict" with two underscores. Before the adoption of C99, if you wanted to use the "restrict" keyword, you had to use the implementation-defined version that has the underscores. Code written to C99 does not use the underscores.
The purpose of the restrict keyword is to stop pointer aliasing for better performance.
What is happening is that somewhere there is a macro
#define __restrict restrict
that is supposed to make pre-C99 code compatible with a C99 compiler. But the code is not being compiled with C99, so restrict isn't being recognized as a keyword. In pre-C99 compilers, the macro above is incorrect.

That much I gathered. I actually decided to get around the problem somewhat creatively. I copied a whole set of C++ includes from a slightly later version of the same compiler. 4.7.4 instead of 4.71

My hope is that it can avoid having to include system headers doing this so we will see in probably about 30 minutes or so when it gets to that section.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-19-2024, 07:53 PM
#45
RE: GCC On IRIX -- a lot of stuff I'm learning about this
(12-19-2024, 07:03 PM)robespierre Wrote:  The code being processed (the top line "stdlib_core.h") is written using a storage class keyword called "__restrict" with two underscores. Before the adoption of C99, if you wanted to use the "restrict" keyword, you had to use the implementation-defined version that has the underscores. Code written to C99 does not use the underscores.
The purpose of the restrict keyword is to stop pointer aliasing for better performance.
What is happening is that somewhere there is a macro
#define __restrict restrict
that is supposed to make pre-C99 code compatible with a C99 compiler. But the code is not being compiled with C99, so restrict isn't being recognized as a keyword. In pre-C99 compilers, the macro above is incorrect.

That much I gathered. So my question is how can I tell GCC if it's in C++ mode to avoid that header? I figure it's going to be some kind of if define but I'm not super familiar with doing this. If you point me in the right direction I can probably figure it out for myself

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-19-2024, 08:03 PM
#46
RE: GCC On IRIX -- a lot of stuff I'm learning about this
Maybe I'm just being obvious but if you invoke the compiler using g++ (as opposed to gcc) it knows you're compiling c++ as opposed to c.

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,245
Threads: 41
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
12-19-2024, 08:56 PM
#47
RE: GCC On IRIX -- a lot of stuff I'm learning about this
The problem is it's for libatomic, so I don't know what I'm doing to be completely honest I'm just going to keep on hacking on it until I figure it out

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-19-2024, 08:59 PM
#48
RE: GCC On IRIX -- a lot of stuff I'm learning about this
Issue stems from the neko_gcc compiler incorrectly understanding whether it's in C++ or C99 mode. I am poking around to fix this.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-20-2024, 05:56 AM
#49
RE: GCC On IRIX -- a lot of stuff I'm learning about this
All right I got through that issue. The way to fix it was to temporarily edit sgimacros.h. this is not a permanent fix but it is necessary to get through this build and I will revert it post that.

New error has been captured. 

In file included from /root/build-4.8/mips-sgi-irix6.5/libstdc++-v3/include/mips-sgi-irix6.5/bits/gthr-default.h:35:0,                                                                              from /root/build-4.8/mips-sgi-irix6.5/libstdc++-v3/include/mips-sgi-irix6.5/bits/gthr.h:148,                                                                                        from /root/build-4.8/mips-sgi-irix6.5/libstdc++-v3/include/ext/concurrence.h:35,
                from ../../../../gcc-4.8.5/libstdc++-v3/libsupc++/eh_alloc.cc:36:        /root/build-4.8/mips-sgi-irix6.5/libstdc++-v3/include/ext/concurrence.h:122:34: error: array must be initialized with a brace-enclosed initializer
    __gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT;
                                  ^                                                      /root/build-4.8/mips-sgi-irix6.5/libstdc++-v3/include/ext/concurrence.h:255:32: error: array must be initialized with a brace-enclosed initializer
    __gthread_cond_t _M_cond = __GTHREAD_COND_INIT;

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-20-2024, 03:19 PM
#50
RE: GCC On IRIX -- a lot of stuff I'm learning about this
This is one of the times where the compiler actually told me what the problem was and I was just being retarded. {} Around those sections fix that

Next problem up.

time_members.cc: In member function 'void std::__timepunct<_CharT>::_M_put(_CharT*, std::size_t, const _CharT*, const tm*) const [with _CharT = wchar_t; std::size_t = unsigned int]': time_members.cc:136:66: error: cannot convert 'const wchar_t*' to 'const char*' for argument '3' to 'size_t wcsftime(wchar_t*, size_t, const char*, const tm*)' const size_t __len = wcsftime(__s, __maxlen, __format, __tm); ^

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-20-2024, 03:33 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)