Issue linking libco

Hello,

I am working on porting a new core to libretro and the project is written in c and I am compiling with gcc.

GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile 'Makefile'...
Reading makefile 'config-host.mak' (search path) (no ~ expansion)...
Reading makefile 'config-all-devices.mak' (search path) (don't care) (no ~ expansion)...
Reading makefile 'config-all-disas.mak' (search path) (don't care) (no ~ expansion)...
Reading makefile '/home/dev/src/rules.mak' (search path) (no ~ expansion)...
Reading makefile 'i386-softmmu-config-devices.mak.d' (search path) (don't care) (no ~ expansion)...
Reading makefile '/home/dev/src/Makefile.objs' (search path) (no ~ expansion)...
Reading makefile '/home/dev/src/crypto/Makefile.objs' (search path) (don't care) (no ~ expansion)...
Reading makefile '/home/dev/src/stubs/Makefile.objs' (search path) (don't care) (no ~ expansion)...
Reading makefile '/home/dev/src/chardev/Makefile.objs' (search path) (don't care) (no ~ expansion)...
Reading makefile '/home/dev/src/qapi/Makefile.objs' (search path) (don't care) (no ~ expansion)...
Removing child 0x1ed53e0 PID 26412 from chain.
    Successfully remade target file 'hw/i386/acpi-build.o'.
    Considering target file 'libretro-common/libco/libco.o'.
     File 'libretro-common/libco/libco.o' does not exist.
     Looking for an implicit rule for 'libretro-common/libco/libco.o'.
     Trying pattern rule with stem 'libco'.
     Trying implicit prerequisite 'libretro-common/libco/libco.c'.
     Found prerequisite 'libretro-common/libco/libco.c' as VPATH '/home/dev/src/libretro-common/libco/libco.c'
     Found an implicit rule for 'libretro-common/libco/libco.o'.
      Considering target file 'libretro-common/libco/libco.c'.
       Looking for an implicit rule for 'libretro-common/libco/libco.c'.
       No implicit rule found for 'libretro-common/libco/libco.c'.
       Finished prerequisites of target file 'libretro-common/libco/libco.c'.
      No need to remake target 'libretro-common/libco/libco.c'; using VPATH name '/home/dev/src/libretro-common/libco/libco.c'.
     Finished prerequisites of target file 'libretro-common/libco/libco.o'.
    Must remake target 'libretro-common/libco/libco.o'.
Putting child 0x1ed5320 (libretro-common/libco/libco.o) PID 26416 on the chain.
Live child 0x1ed5320 (libretro-common/libco/libco.o) PID 26416
  CC      i386-softmmu/libretro-common/libco/libco.o
In file included from /home/dev/src/libretro-common/libco/libco.c:22:0:
/home/dev/src/libretro-common/libco/amd64.c:116:6: error: no previous prototype for 'co_init' [-Werror=missing-prototypes]
 void co_init(void) {}
      ^~~~~~~
cc1: all warnings being treated as errors
Reaping losing child 0x1ed5320 PID 26416
make[1]: *** [/home/dev/src/rules.mak:66: libretro-common/libco/libco.o] Error 1
Removing child 0x1ed5320 PID 26416 from chain.
Reaping losing child 0x188bb70 PID 26047
make: *** [Makefile:387: subdir-i386-softmmu] Error 2
Removing child 0x188bb70 PID 26047 from chain.
2 Likes

What happens if you don’t compile with -Werror?

EDIT: if you want, just come to the libretro discord server or #retroarch on Freenode IRC and we can talk it out in real time.

Oh! It compiles with that!

I am still getting a segmentation fault when I run `retroarch --verbose -L i386-softmmu/qemu_libretro.so but I am closer than I was before.

[INFO] === Build =======================================
Capabilities: MMX MMXEXT SSE1 SSE2 SSE3 SSSE3 SSE4 SSE4.2 AVX AES 
Built: Dec 30 2017
[INFO] Version: 1.6.7
[INFO] =================================================
[INFO] [Config]: Loading default config.
[INFO] [Config]: loading config from: (null).
[INFO] Looking for config in: "/home/dev/.config/retroarch/retroarch.cfg".
[WARN] screenshot_directory is not an existing directory, ignoring ...
[WARN] savefile_directory is not a directory, ignoring ...
[WARN] savestate_directory is not a directory, ignoring ...
[INFO] Loading dynamic libretro core from: "/home/dev/src/build/i386-softmmu/qemu_libretro.so"
[INFO] Environ SET_SUPPORT_NO_GAME: yes.
[INFO] Environ SET_VARIABLES.
[INFO] Environ SET_CONTROLLER_INFO.
[INFO] Controller port: 1
[INFO]    Keyboard (ID: 771)
[INFO]    (null) (ID: 0)
[INFO]    Reserved (ID: 2766475066)
[INFO] Environ SYSTEM_DIRECTORY: "/home/dev/.local/share/retroarch/system/".
[INFO] Environ CORE_ASSETS_DIRECTORY: "/home/dev/.config/retroarch/downloads".
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Logger interface initialized... 
[INFO] Content loading skipped. Implementation will load it on its own.
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] Found shader "/usr/share/libretro/shaders/slang-conversion-template.glsl"
[INFO] Found shader "/usr/share/libretro/shaders/stock.glsl"
[INFO] [Video]: Video @ 2400x1800
[WARN] 0RGB1555 pixel format is deprecated, and will be slower. For 15/16-bit, RGB565 format is preferred.
[INFO] [GL]: Found GL context: null
[INFO] [GL]: Detecting screen resolution 320x240.
[INFO] [GL]: Vendor: (null), Renderer: (null).
[INFO] [GL]: Version: (null).
/usr/bin/xvfb-run: line 183: 27921 Segmentation fault      DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1

I will try to hop on there this evening.

2 Likes