pkgconf - still not building with MIPSPro
#1
pkgconf - still not building with MIPSPro
pkgconf, a replacement for, and lighterweight version of, pkg-config is not building with MIPSPro. We've discussed this before:

~/pkgconf-0.9.6 % /usr/local/bin/make -j3
c99 -c -O2 -mips4 -TARG:proc=r10000 -DLIBDIR=\"/usr/share/bsd/lib32\" -DINCLUDEDIR=\"/usr/share/bsd/include\" -DPKG_DEFAULT_PATH=\"/usr/share/bsd/lib32/pkgconfig:/u
sr/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/usr/share/bsd/include\" -DSYSTEM_LIBDIR=\"/usr/share/bsd/lib32\" -Wall  -I. -I/usr/include -I/usr/gnu/include main.c -o
main.o
c99 -c -O2 -mips4 -TARG:proc=r10000 -DLIBDIR=\"/usr/share/bsd/lib32\" -DINCLUDEDIR=\"/usr/share/bsd/include\" -DPKG_DEFAULT_PATH=\"/usr/share/bsd/lib32/pkgconfig:/u
sr/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/usr/share/bsd/include\" -DSYSTEM_LIBDIR=\"/usr/share/bsd/lib32\" -Wall  -I. -I/usr/include -I/usr/gnu/include cache.c -o
cache.o
c99 -c -O2 -mips4 -TARG:proc=r10000 -DLIBDIR=\"/usr/share/bsd/lib32\" -DINCLUDEDIR=\"/usr/share/bsd/include\" -DPKG_DEFAULT_PATH=\"/usr/share/bsd/lib32/pkgconfig:/u
sr/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/usr/share/bsd/include\" -DSYSTEM_LIBDIR=\"/usr/share/bsd/lib32\" -Wall  -I. -I/usr/include -I/usr/gnu/include pkg.c -o p
kg.o
cc-1110 c99: REMARK File = main.c, Line = 627
  The indicated statement is not reachable.

                        break;
                        ^

cc-3943 c99: REMARK File = pkg.c, Line = 474
  declaration hides variable "pkg" (declared at line 463)

                        pkg_t *pkg;
                              ^

Signal: Segmentation fault in Scope Setup phase.
Error: Signal Segmentation fault in phase Scope Setup -- processing aborted
c99 ERROR:  /usr/lib32/cmplrs/fec died due to signal 4
c99 ERROR:  core dumped
Makefile:47: recipe for target 'pkg.o' failed


Clearly, something in pkg.c is killing the compiler. It's post-preprocessor, but during compilation and after line 474

https://github.com/pkgconf/pkgconf/relea...conf-0.9.6

If someone wants to try the same version, though later versions have similar problems with pkg.c when you get over the hump. 

I know this is a C scope issue, but I don't know how to diagnose it further. Does this mean that a C function is just going too deep in scope???

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
05-02-2021, 10:50 PM
#2
RE: pkgconf - still not building with MIPSPro
I don't know if either of the "REMARKs" is the root cause of the problem, but they're easy to fix.

(05-02-2021, 10:50 PM)Raion Wrote:  cc-1110 c99: REMARK File = main.c, Line = 627
  The indicated statement is not reachable.

                        break;
                        ^

Line 627 of main.c in that particular version of pkgconf is a break statement right after a return.  It is obviously unreachable and (understandably) MIPSPro doesn't like it.  Just delete the line with break on it (right after "return EXIT_FAILURE;").

(05-02-2021, 10:50 PM)Raion Wrote:  cc-3943 c99: REMARK File = pkg.c, Line = 474
  declaration hides variable "pkg" (declared at line 463)

                        pkg_t *pkg;
                              ^

This one is a case of declaring the same variable twice, on lines 463 and 474.  Delete the second declaration on line 474.

I suspect it is the double-declaration that is confusing the compiler to the point of segfaulting but I make no promises (LOL).

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
05-03-2021, 12:48 AM
#3
RE: pkgconf - still not building with MIPSPro
% gmake -j3
c99 -c -O3 -mips4 -TARG:proc=r10000 -DLIBDIR=\"/usr/share/bsd/lib32\" -DINCLUDEDIR=\"/usr/share/bsd/include\" -DPKG_DEFAULT_PATH=\"/usr/share/bsd/lib32/pkgconfig:/usr/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/usr/share/bsd/include\" -DSYSTEM_LIBDIR=\"/usr/share/bsd/lib32\" -Wall -I. -I/usr/include main.c -o main.o
c99 -c -O3 -mips4 -TARG:proc=r10000 -DLIBDIR=\"/usr/share/bsd/lib32\" -DINCLUDEDIR=\"/usr/share/bsd/include\" -DPKG_DEFAULT_PATH=\"/usr/share/bsd/lib32/pkgconfig:/usr/share/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/usr/share/bsd/include\" -DSYSTEM_LIBDIR=\"/usr/share/bsd/lib32\" -Wall -I. -I/usr/include pkg.c -o pkg.o
Signal: Segmentation fault in Scope Setup phase.
Error: Signal Segmentation fault in phase Scope Setup -- processing aborted
c99 ERROR: /usr/lib32/cmplrs/fec died due to signal 4
c99 ERROR: core dumped
gmake: *** [pkg.o] Error 32
gmake: *** Waiting for unfinished jobs....

I didn't anticipate that would fix 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
05-03-2021, 02:59 AM
#4
RE: pkgconf - still not building with MIPSPro
Oh well, it was worth a shot.  I was hoping "Scope Setup" was referring to the scope of the duplicate variable names.  I guess not.  (Aside:  warnings like those -- especially since they were from just plain sloppy code -- really get on my nerves and I can't fight the tendency to fix them.)

There's something wrong with the input C file that will require a much deeper dive than I have time for.  Valid C should never cause a compiler crash.  Maybe somebody with more knowledge of the compiler internals will pop up to offer some assistance....

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
05-03-2021, 03:41 AM
#5
RE: pkgconf - still not building with MIPSPro
Yeah. PKGCONF is mostly a better option than pkg-config for three reasons:

1. it doesn't depend on anything else
2. It is currently developed and exceeds pkg-config specifications
3. It has better performance

I can build it with GCC - it's not the /end/ of the world.

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
05-03-2021, 03:43 AM
#6
RE: pkgconf - still not building with MIPSPro
I spent a bit more time on this yesterday.  I had three more ideas to explore.  Unfortunately they all failed.  I'm working on one more.

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
05-05-2021, 11:47 PM
#7
RE: pkgconf - still not building with MIPSPro
And that's yet another dead end for me on this one.  I give up.

I tried to:
  1. Remove the duplicate variable of the same name, as mentioned earlier in this thread.
  2. Remove the variable declarations from "if" blocks and other similar contexts.  That's allowed in c99 but not older standards, so I thought maybe MIPSPro wasn't handling it correctly.  Not the problem.
  3. Remove the static variables from functions on the chance that they were confusing the compiler.  (Something I saw online gave me that idea.)  Still not the problem.

I post my failures here so that other people don't waste their time duplicating the effort.  (I think there was a fourth failure, but I'm drawing a blank at the moment.)

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
05-06-2021, 11:24 PM
#8
RE: pkgconf - still not building with MIPSPro
Don't worry about it then. I will see if I can get farther.

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
05-06-2021, 11:58 PM
#9
RE: pkgconf - still not building with MIPSPro
Code:
static pkg_t pkg_config_virtual = {
        .id = "pkg-config",
        .realname = "pkg-config",
        .description = "virtual package defining pkg-config API version supported",
        .url = PACKAGE_BUGREPORT,
        .version = PKG_PKGCONFIG_VERSION_EQUIV,
        .flags = PKG_PROPF_VIRTUAL,
        .vars = {
                .head = &(pkg_node_t){
                        .prev = NULL,
                        .next = NULL,
                        .data = &(pkg_tuple_t){
                                .key = "pc_path",
                        },
                },
                .tail = NULL,
        },
};

It's this.

Something here is breaking MIPSPro. I figured it out by blindly deleting functions and structs from the file one at a time.

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.
(This post was last modified: 05-07-2021, 06:12 AM by Raion.)
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
05-07-2021, 12:13 AM
#10
RE: pkgconf - still not building with MIPSPro
update. This struct appears once in the code of this version of pkgconf, in a function verifying the dependency graph. I think this struct needs to be changed around but I have no idea where to begin. I guess I'll poke at it later when I'm well-rested, but I'm glad to be near the end of this.

Once I know this, I can go to higher versions of pkgconf and fix it there and perhaps upstream a patch. Maybe. I doubt it, but still.

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
05-07-2021, 06:14 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)