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

Build fails on physfs: #1167

Closed
TheCycoONE opened this issue May 30, 2024 · 1 comment · Fixed by #1184
Closed

Build fails on physfs: #1167

TheCycoONE opened this issue May 30, 2024 · 1 comment · Fixed by #1184
Assignees
Labels

Comments

@TheCycoONE
Copy link

On Arch Linux with gcc 14.1.1 the build is failing on physfs. When I build physfs alone from it's repo on the same commit it works fine.

make -j5  
[  1%] Building C object CMakeFiles/c-hashmap-static.dir/home/family/projects/VVVVVV/third_party/c-hashmap/map.c.o
[  2%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio.c.o
[  3%] Building C object CMakeFiles/lodepng-static.dir/src/lodepng_wrapper.c.o
[  4%] Building C object CMakeFiles/sheenbidi-static.dir/home/family/projects/VVVVVV/third_party/SheenBidi/Source/SheenBidi.c.o
-- This is interim commit 16d75d2d (committed 2024-05-25) on branch master
[  4%] Built target GenerateVersion
[  6%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio_internal.c.o
[  7%] Linking C static library libc-hashmap-static.a
[  7%] Built target c-hashmap-static
[  8%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio_internal_simd.c.o
[  9%] Building CXX object CMakeFiles/tinyxml2-static.dir/home/family/projects/VVVVVV/third_party/tinyxml2/tinyxml2.cpp.o
[ 11%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio_operationset.c.o
[ 12%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs.c.o
[ 13%] Linking C static library libsheenbidi-static.a
[ 13%] Built target sheenbidi-static
[ 14%] Building C object CMakeFiles/faudio-static.dir/home/family/projects/VVVVVV/third_party/FAudio/src/FAudio_platform_sdl2.c.o
[ 16%] Building C object CMakeFiles/InterimVersion.dir/src/InterimVersion.out.c.o
[ 17%] Linking C static library libInterimVersion.a
[ 17%] Built target InterimVersion
[ 18%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_archiver_dir.c.o
[ 20%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_archiver_unpacked.c.o
[ 20%] Linking C static library liblodepng-static.a
[ 22%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_archiver_zip.c.o
[ 23%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_byteorder.c.o
[ 24%] Linking CXX static library libtinyxml2-static.a
[ 24%] Built target lodepng-static
[ 25%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_unicode.c.o
[ 25%] Built target tinyxml2-static
[ 27%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_unix.c.o
[ 28%] Building C object CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_posix.c.o
/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_unix.c: In function ‘readSymLink’:
/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_unix.c:230:15: error: implicit declaration of function ‘readlink’ [-Wimplicit-function-declaration]
  230 |          rc = readlink(path, retval, len);
      |               ^~~~~~~~
make[2]: *** [CMakeFiles/physfs-static.dir/build.make:174: CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_unix.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_posix.c: In function ‘__PHYSFS_platformStat’:
/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_posix.c:334:53: error: implicit declaration of function ‘lstat’; did you mean ‘fstat’? [-Wimplicit-function-declaration]
  334 |     const int rc = follow ? stat(fname, &statbuf) : lstat(fname, &statbuf);
      |                                                     ^~~~~
      |                                                     fstat
make[2]: *** [CMakeFiles/physfs-static.dir/build.make:160: CMakeFiles/physfs-static.dir/home/family/projects/VVVVVV/third_party/physfs/src/physfs_platform_posix.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:288: CMakeFiles/physfs-static.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 29%] Linking C static library libfaudio-static.a
[ 29%] Built target faudio-static
make: *** [Makefile:91: all] Error 2
@homeisfar
Copy link

homeisfar commented Jun 27, 2024

You can unset compliance with C99 in the cmakelists to get past this. Comment out lines 303 and 304 in desktop_version/CMakeLists.txt, produce a clean build directory, then compile. My preferred way:

mkdir build; cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4

InfoTeddy added a commit to InfoTeddy/VVVVVV that referenced this issue Jul 12, 2024
Due to a confluence of weird factors, it turns out that PhysFS is
compiling with implicit function definitions due to function definitions
that get hidden with -std=c99, but not with -std=gnu99 (or the default
GCC value of -std=gnu17).

Also, due to a recent GCC update (GCC 14), implicit function
declarations are actually prohibited with -std=c99 as the C99 standard
proscribes.

This meant that people started getting build errors in PhysFS code on
default settings, which wasn't ideal.

To fix this, we will make our -std= flags apply only to VVVVVV source
files. In CMake 2.8.12, this can be done with
set_source_files_properties. Additionally the flags to disable
exceptions and RTTI are scoped down too.

Thanks to leo60228 for helping debug and solve this issue.

Fixes TerryCavanagh#1167.
@InfoTeddy InfoTeddy added the bug label Jul 12, 2024
@InfoTeddy InfoTeddy self-assigned this Jul 12, 2024
InfoTeddy added a commit that referenced this issue Jul 13, 2024
Due to a confluence of weird factors, it turns out that PhysFS is
compiling with implicit function definitions due to function definitions
that get hidden with -std=c99, but not with -std=gnu99 (or the default
GCC value of -std=gnu17).

Also, due to a recent GCC update (GCC 14), implicit function
declarations are actually prohibited with -std=c99 as the C99 standard
proscribes.

This meant that people started getting build errors in PhysFS code on
default settings, which wasn't ideal.

To fix this, we will make our -std= flags apply only to VVVVVV source
files. In CMake 2.8.12, this can be done with
set_source_files_properties. Additionally the flags to disable
exceptions and RTTI are scoped down too.

Thanks to leo60228 for helping debug and solve this issue.

Fixes #1167.
leo60228 pushed a commit to leo60228/VVVVVV that referenced this issue Oct 10, 2024
Due to a confluence of weird factors, it turns out that PhysFS is
compiling with implicit function definitions due to function definitions
that get hidden with -std=c99, but not with -std=gnu99 (or the default
GCC value of -std=gnu17).

Also, due to a recent GCC update (GCC 14), implicit function
declarations are actually prohibited with -std=c99 as the C99 standard
proscribes.

This meant that people started getting build errors in PhysFS code on
default settings, which wasn't ideal.

To fix this, we will make our -std= flags apply only to VVVVVV source
files. In CMake 2.8.12, this can be done with
set_source_files_properties. Additionally the flags to disable
exceptions and RTTI are scoped down too.

Thanks to leo60228 for helping debug and solve this issue.

Fixes TerryCavanagh#1167.

(cherry picked from commit ff611a5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants