mywave82 / opencubicplayer

Open Cubic Player (unix fork). Music visualizer for various tracked music formats (amiga modules, S3M, IT), chiptunes and other formats related to demoscene
https://stian.cubic.org/project-ocp.php
GNU General Public License v2.0
280 stars 19 forks source link

osx compilation issue #73

Closed chenrui333 closed 1 year ago

chenrui333 commented 1 year ago

Got some build errors when building 0.2.100, the error is as below:

clang -g -O2 -fno-common -fPIC -Wall -I.././ plinkman.c -o plinkman.o -c
plinkman.c:62:1: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma
DLLEXTINFO_BEGIN_PREFIX struct linkinfostruct staticdlls = {.name = "static", .desc = "Compiled in plugins (c) 2009-'22 Stian Skjelstad", .ver = DLLVERSION};
^
./plinkman.h:64:65: note: expanded from macro 'DLLEXTINFO_BEGIN_PREFIX'
# define DLLEXTINFO_BEGIN_PREFIX const __attribute__ ((section ("plugin_list"))) __attribute__ ((used))
                                                                ^
1 error generated.

relates to https://github.com/Homebrew/homebrew-core/pull/111587

mywave82 commented 1 year ago

mach-o

Which version of clang, and what is your host system (version, CPU etc)

mywave82 commented 1 year ago

Might be that apple needs to have a special case for these macros.

#ifdef APPLE
# define DLLEXTINFO_BEGIN_PREFIX const __attribute__ ((section ("__DATA,plugin_list"))) __attribute__ ((used))
#else
# define DLLEXTINFO_BEGIN_PREFIX const __attribute__ ((section ("plugin_list"))) __attribute__ ((used))
#endif

and similiar for the others.

mywave82 commented 1 year ago

Should be fixed by d37938f8a43f3c784c7742cdcc3dd16af8d79751