It was found that doomlegacy gives errors (does not link) with a recent Clang 3.7.0 snapshot:
Linking... [...] objs/m_menu.o: In function `M_DrawDir': src/m_menu.c:(.text+0x3ace): undefined reference to `draw_dir_line' objs/m_menu.o: In function `M_DrawLoad': src/m_menu.c:(.text+0x468c): undefined reference to `draw_dir_line' cc: error: linker command failed with exit code 1 (use -v to see invocation) Makefile:980: recipe for target 'bin/doomlegacy' failed gmake[1]: *** [bin/doomlegacy] Error 1
This is because the program uses the wrong form of inline function, causing linking to fail. This can be fixed easily by using "static inline" instead:
--- src/m_menu.c.orig 2014-10-07 12:37:24.000000000 +0200 +++ src/m_menu.c 2015-08-19 23:41:23.458114000 +0200 @@ -2677,7 +2677,7 @@ menu_t DirDef = // Draw the current DIR line above list -inline void draw_dir_line( int line_y ) +static inline void draw_dir_line( int line_y ) { V_DrawString( DirDef.x, line_y, 0, "DIR"); M_DrawSaveLoadBorder( DirDef.x+32, line_y, 0);
Originally reported by Dimitry Andric for FreeBSD (PR 202498).
The INLINE on that function was removed some time ago:
Apr 2, 2015.
*** W102_makefile
patchfile = w102_19_makefile.patch
- commit revision 1158
Fix problems with directories when compiling in Win32.
Fix some debugging of inline functions reported.
Doomlegacy is at revision 1174 now.
Check the INLINE in w_wad.c. That one cannot be made static. Probably will have to remove that one too. But I do not understand why CLANG fails so badly when a function has INLINE on it. It is not like it makes it a different function.