Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build with EXTERNAL_DATA=1 #555

Closed
duganchen opened this issue Apr 24, 2024 · 3 comments
Closed

Unable to build with EXTERNAL_DATA=1 #555

duganchen opened this issue Apr 24, 2024 · 3 comments

Comments

@duganchen
Copy link

This happens on Fedora 40.

> make EXTERNAL_DATA=1
make[1]: Entering directory '/home/dugan/Documents/sm64ex/tools'
make[1]: Nothing to be done for 'default'.
make[1]: Leaving directory '/home/dugan/Documents/sm64ex/tools'
In file included from src/pc/gfx/gfx_pc.c:11:
include/stb/stb_image.h: In function 'stbi__gif_load_next':
include/stb/stb_image.h:6339:84: warning: unused parameter 'req_comp' [-Wunused-parameter]
 6339 | static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp, stbi_uc *two_back)
      |                                                                                ~~~~^~~~~~~~
include/stb/stb_image.h: In function 'stbi__gif_load':
include/stb/stb_image.h:6563:107: warning: unused parameter 'ri' [-Wunused-parameter]
 6563 | static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
      |                                                                                        ~~~~~~~~~~~~~~~~~~~^~
src/pc/gfx/gfx_pc.c: In function 'gfx_flush':
src/pc/gfx/gfx_pc.c:209:23: warning: unused variable 't1' [-Wunused-variable]
  209 |         unsigned long t1 = get_time();
      |                       ^~
src/pc/gfx/gfx_pc.c:205:23: warning: unused variable 't0' [-Wunused-variable]
  205 |         unsigned long t0 = get_time();
      |                       ^~
src/pc/gfx/gfx_pc.c:204:13: warning: unused variable 'num' [-Wunused-variable]
  204 |         int num = buf_vbo_num_tris;
      |             ^~~
src/pc/gfx/gfx_pc.c: In function 'load_texture':
src/pc/gfx/gfx_pc.c:514:42: error: passing argument 2 of 'fs_load_file' from incompatible pointer type [-Wincompatible-pointer-types]
  514 |     u8 *imgdata = fs_load_file(fullpath, &imgsize);
      |                                          ^~~~~~~~
      |                                          |
      |                                          u64 * {aka long long unsigned int *}
In file included from src/pc/gfx/gfx_pc.c:29:
src/pc/gfx/../fs/fs.h:116:49: note: expected 'uint64_t *' {aka 'long unsigned int *'} but argument is of type 'u64 *' {aka 'long long unsigned int *'}
  116 | void *fs_load_file(const char *vpath, uint64_t *outsize);
      |                                       ~~~~~~~~~~^~~~~~~
src/pc/gfx/gfx_pc.c: In function 'preload_texture':
src/pc/gfx/gfx_pc.c:592:42: warning: pointer targets in passing argument 3 of 'gfx_texture_cache_lookup' differ in signedness [-Wpointer-sign]
  592 |     if (!gfx_texture_cache_lookup(0, &n, actualname, fmt, siz))
      |                                          ^~~~~~~~~~
      |                                          |
      |                                          char *
src/pc/gfx/gfx_pc.c:290:94: note: expected 'const uint8_t *' {aka 'const unsigned char *'} but argument is of type 'char *'
  290 | static bool gfx_texture_cache_lookup(int tile, struct TextureHashmapNode **n, const uint8_t *orig_addr, uint32_t fmt, uint32_t siz) {
      |                                                                               ~~~~~~~~~~~~~~~^~~~~~~~~
src/pc/gfx/gfx_pc.c:569:35: warning: unused parameter 'user' [-Wunused-parameter]
  569 | static bool preload_texture(void *user, const char *path) {
      |                             ~~~~~~^~~~
src/pc/gfx/gfx_pc.c: In function 'gfx_sp_moveword':
src/pc/gfx/gfx_pc.c:1133:53: warning: unused parameter 'offset' [-Wunused-parameter]
 1133 | static void gfx_sp_moveword(uint8_t index, uint16_t offset, uint32_t data) {
      |                                            ~~~~~~~~~^~~~~~
src/pc/gfx/gfx_pc.c: In function 'gfx_sp_texture':
src/pc/gfx/gfx_pc.c:1152:62: warning: unused parameter 'level' [-Wunused-parameter]
 1152 | static void gfx_sp_texture(uint16_t sc, uint16_t tc, uint8_t level, uint8_t tile, uint8_t on) {
      |                                                      ~~~~~~~~^~~~~
src/pc/gfx/gfx_pc.c:1152:77: warning: unused parameter 'tile' [-Wunused-parameter]
 1152 | static void gfx_sp_texture(uint16_t sc, uint16_t tc, uint8_t level, uint8_t tile, uint8_t on) {
      |                                                                     ~~~~~~~~^~~~
src/pc/gfx/gfx_pc.c:1152:91: warning: unused parameter 'on' [-Wunused-parameter]
 1152 | static void gfx_sp_texture(uint16_t sc, uint16_t tc, uint8_t level, uint8_t tile, uint8_t on) {
      |                                                                                   ~~~~~~~~^~
src/pc/gfx/gfx_pc.c: In function 'gfx_dp_set_scissor':
src/pc/gfx/gfx_pc.c:1157:41: warning: unused parameter 'mode' [-Wunused-parameter]
 1157 | static void gfx_dp_set_scissor(uint32_t mode, uint32_t ulx, uint32_t uly, uint32_t lrx, uint32_t lry) {
      |                                ~~~~~~~~~^~~~
src/pc/gfx/gfx_pc.c: In function 'gfx_dp_set_texture_image':
src/pc/gfx/gfx_pc.c:1171:47: warning: unused parameter 'format' [-Wunused-parameter]
 1171 | static void gfx_dp_set_texture_image(uint32_t format, uint32_t size, uint32_t width, const void* addr) {
      |                                      ~~~~~~~~~^~~~~~
src/pc/gfx/gfx_pc.c:1171:79: warning: unused parameter 'width' [-Wunused-parameter]
 1171 | static void gfx_dp_set_texture_image(uint32_t format, uint32_t size, uint32_t width, const void* addr) {
      |                                                                      ~~~~~~~~~^~~~~
src/pc/gfx/gfx_pc.c: In function 'gfx_dp_set_tile':
src/pc/gfx/gfx_pc.c:1176:141: warning: unused parameter 'maskt' [-Wunused-parameter]
 1176 | static void gfx_dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t tmem, uint8_t tile, uint32_t palette, uint32_t cmt, uint32_t maskt, uint32_t shiftt, uint32_t cms, uint32_t masks, uint32_t shifts) {
      |                                                                                                                                    ~~~~~~~~~^~~~~
src/pc/gfx/gfx_pc.c:1176:157: warning: unused parameter 'shiftt' [-Wunused-parameter]
 1176 | static void gfx_dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t tmem, uint8_t tile, uint32_t palette, uint32_t cmt, uint32_t maskt, uint32_t shiftt, uint32_t cms, uint32_t masks, uint32_t shifts) {
      |                                                                                                                                                    ~~~~~~~~~^~~~~~
src/pc/gfx/gfx_pc.c:1176:188: warning: unused parameter 'masks' [-Wunused-parameter]
 1176 | tatic void gfx_dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t tmem, uint8_t tile, uint32_t palette, uint32_t cmt, uint32_t maskt, uint32_t shiftt, uint32_t cms, uint32_t masks, uint32_t shifts) {
      |                                                                                                                                                                                  ~~~~~~~~~^~~~~

src/pc/gfx/gfx_pc.c:1176:204: warning: unused parameter 'shifts' [-Wunused-parameter]
 1176 | _dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t tmem, uint8_t tile, uint32_t palette, uint32_t cmt, uint32_t maskt, uint32_t shiftt, uint32_t cms, uint32_t masks, uint32_t shifts) {
      |                                                                                                                                                                                    ~~~~~~~~~^~~~~~

src/pc/gfx/gfx_pc.c: In function 'gfx_dp_load_tlut':
src/pc/gfx/gfx_pc.c:1205:53: warning: unused parameter 'high_index' [-Wunused-parameter]
 1205 | static void gfx_dp_load_tlut(uint8_t tile, uint32_t high_index) {
      |                                            ~~~~~~~~~^~~~~~~~~~
src/pc/gfx/gfx_pc.c: In function 'gfx_dp_load_block':
src/pc/gfx/gfx_pc.c:1211:96: warning: unused parameter 'dxt' [-Wunused-parameter]
 1211 | static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t lrs, uint32_t dxt) {
      |                                                                                       ~~~~~~~~~^~~
src/pc/gfx/gfx_pc.c: In function 'gfx_dp_texture_rectangle':
src/pc/gfx/gfx_pc.c:1407:98: warning: unused parameter 'tile' [-Wunused-parameter]
 1407 | static void gfx_dp_texture_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lry, uint8_t tile, int16_t uls, int16_t ult, int16_t dsdx, int16_t dtdy, bool flip) {
      |                                                                                          ~~~~~~~~^~~~
src/pc/gfx/gfx_pc.c: In function 'gfx_dp_set_color_image':
src/pc/gfx/gfx_pc.c:1487:45: warning: unused parameter 'format' [-Wunused-parameter]
 1487 | static void gfx_dp_set_color_image(uint32_t format, uint32_t size, uint32_t width, void* address) {
      |                                    ~~~~~~~~~^~~~~~
src/pc/gfx/gfx_pc.c:1487:62: warning: unused parameter 'size' [-Wunused-parameter]
 1487 | static void gfx_dp_set_color_image(uint32_t format, uint32_t size, uint32_t width, void* address) {
      |                                                     ~~~~~~~~~^~~~
src/pc/gfx/gfx_pc.c:1487:77: warning: unused parameter 'width' [-Wunused-parameter]
 1487 | static void gfx_dp_set_color_image(uint32_t format, uint32_t size, uint32_t width, void* address) {
      |                                                                    ~~~~~~~~~^~~~~
src/pc/gfx/gfx_pc.c: In function 'gfx_run_dl':
src/pc/gfx/gfx_pc.c:1507:9: warning: unused variable 'dummy' [-Wunused-variable]
 1507 |     int dummy = 0;
      |         ^~~~~
src/pc/gfx/gfx_pc.c: In function 'gfx_run':
src/pc/gfx/gfx_pc.c:1798:12: warning: unused variable 't1' [-Wunused-variable]
 1798 |     double t1 = gfx_wapi->get_time();
      |            ^~
src/pc/gfx/gfx_pc.c:1794:12: warning: unused variable 't0' [-Wunused-variable]
 1794 |     double t0 = gfx_wapi->get_time();
      |            ^~
make: *** [Makefile:1020: build/us_pc/src/pc/gfx/gfx_pc.o] Error 1
@fgsfdsfgs
Copy link
Collaborator

What version of GCC or Clang are you using? Do you have anything in the CFLAGS environment variable by any chance?

@duganchen
Copy link
Author

dugan@node-1w7jr9qsdtvv3qoqmeqeu3ani ~> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/14/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-14.0.1-20240411/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none,amdgcn-amdhsa --enable-offload-defaulted --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240411 (Red Hat 14.0.1-0) (GCC) 
dugan@node-1w7jr9qsdtvv3qoqmeqeu3ani ~> echo $CFLAGS

dugan@node-1w7jr9qsdtvv3qoqmeqeu3ani ~> 

@fgsfdsfgs
Copy link
Collaborator

fgsfdsfgs commented Apr 24, 2024

Guess that warning is now an error by default in GCC14 or something. I'll fix that when I can, but for now you can add -Wno-incompatible-pointer-types to CFLAGS on this line in the Makefile. And make a clean build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants