caryll / otfcc

Optimized OpenType builder and inspector.
Apache License 2.0
422 stars 63 forks source link

Unable to build with latest gcc (6.2.1-5) #43

Closed S1ohy closed 7 years ago

S1ohy commented 7 years ago
[~/bin/otfcc-0.6.3]: gcc --version
gcc (Debian 6.2.1-5) 6.2.1 20161124

[~/bin/otfcc-0.6.3]: premake5 gmake
Building configurations...
Running action 'gmake'...
Generated build/gmake/Makefile...
Generated build/gmake/deps.make...
Generated build/gmake/libotfcc.make...
Generated build/gmake/otfccdump.make...
Generated build/gmake/otfccbuild.make...
Done (164ms).
[~/bin/otfcc-0.6.3]: cd build/gmake/
[~/bin/otfcc-0.6.3/build/gmake]: make
==== Building deps (debug_x32) ====
Creating bin/x32/Debug
Creating obj/x32/Debug/deps
emyg-dtoa.c
json-builder.c
json.c
sds.c
Linking deps
==== Building libotfcc (debug_x32) ====
Creating obj/x32/Debug/libotfcc
bkblock.c
bkgraph.c
consolidate.c
GDEF.c
chaining.c
common.c
gpos-cursive.c
gpos-pair.c
gpos-single.c
gsub-ligature.c
gsub-multi.c
gsub-reverse.c
gsub-single.c
mark.c
caryll-font.c
caryll-sfnt-builder.c
caryll-sfnt.c
json-reader.c
json-writer.c
cff-charset.c
cff-codecs.c
cff-dict.c
cff-fdselect.c
cff-index.c
cff-opmean.c
cff-parser.c
cff-string.c
cff-value.c
cff-writer.c
charstring-il.c
subr.c
logger.c
otf-reader.c
unconsolidate.c
otf-writer.c
stat.c
aglfn.c
base64.c
buffer.c
glyph-order.c
handle.c
json-ident.c
options.c
primitives.c
sha1.c
ttinstr.c
unicodeconv.c
BASE.c
CFF.c
COLR.c
CPAL.c
GDEF.c
LTSH.c
OS_2.c
SVG.c
../../lib/table/SVG.c: In function ‘otfcc_buildSVG’:
../../lib/table/SVG.c:129:12: warning: ‘main’ is usually a function [-Wmain]
  bk_Block *main = bk_new_Block(b16, svg.length, // numEntries
            ^~~~
VORG.c
cmap.c
cvt.c
fpgm-prep.c
gasp.c
glyf.c
hdmx.c
head.c
hhea.c
hmtx.c
maxp.c
name.c
build.c
classdef.c
constants.c
coverage.c
dump.c
otl.c
parse.c
read.c
build.c
classifier.c
common.c
dump.c
parse.c
read.c
extend.c
gpos-common.c
gpos-cursive.c
gpos-mark-to-ligature.c
gpos-mark-to-single.c
gpos-pair.c
gpos-single.c
gsub-ligature.c
gsub-multi.c
gsub-reverse.c
gsub-single.c
post.c
vhea.c
vmtx.c
functional.c
Linking libotfcc
==== Building otfccdump (debug_x32) ====
Creating ../../bin/Debug-x32
Creating obj/x32/Debug/otfccdump
otfccdump.c
../../src/otfccdump.c: In function ‘main’:
../../src/otfccdump.c:57:7: warning: variable ‘no_bom’ set but not used [-Wunused-but-set-variable]
  bool no_bom = false;
       ^~~~~~
stopwatch.c
Linking otfccdump
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/6/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/6/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
otfccdump.make:138: recipe for target '../../bin/Debug-x32/otfccdump' failed
make[1]: *** [../../bin/Debug-x32/otfccdump] Error 1
Makefile:58: recipe for target 'otfccdump' failed
make: *** [otfccdump] Error 2
[~/bin/otfcc-0.6.3/build/gmake]: 

Downloaded otfcc from https://github.com/caryll/otfcc/archive/v0.6.3.tar.gz Downloaded premake5 from https://github.com/premake/premake-core/releases/download/v5.0.0-alpha10/premake-5.0.0-alpha10-linux.tar.gz

Running Debian Sid/Testing

be5invis commented 7 years ago

What’s your otfccbuild.make?

be5invis commented 7 years ago

In build/gmake.

be5invis commented 7 years ago

If you are going to make the release version, you should type

make config=release_x64
S1ohy commented 7 years ago

@be5invis

# GNU Make project makefile autogenerated by Premake

ifndef config
  config=debug_x32
endif

ifndef verbose
  SILENT = @
endif

.PHONY: clean prebuild prelink

ifeq ($(config),debug_x32)
  RESCOMP = windres
  TARGETDIR = ../../bin/Debug-x32
  TARGET = $(TARGETDIR)/otfccbuild
  OBJDIR = obj/x32/Debug/otfccbuild
  DEFINES += -D_CARYLL_USE_PRE_SERIALIZED -DMAIN_VER=0 -DSECONDARY_VER=6 -DPATCH_VER=3 -DDEBUG -D_DEBUG
  INCLUDES += -I../../include
  FORCE_INCLUDE +=
  ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
  ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g -std=gnu11 -Wall -Wno-multichar
  ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
  ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
  LIBS += bin/x32/Debug/liblibotfcc.a bin/x32/Debug/libdeps.a -lm
  LDDEPS += bin/x32/Debug/liblibotfcc.a bin/x32/Debug/libdeps.a
  ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32
  LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
  define PREBUILDCMDS
  endef
  define PRELINKCMDS
  endef
  define POSTBUILDCMDS
  endef
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
    @:

endif

ifeq ($(config),debug_x64)
  RESCOMP = windres
  TARGETDIR = ../../bin/Debug-x64
  TARGET = $(TARGETDIR)/otfccbuild
  OBJDIR = obj/x64/Debug/otfccbuild
  DEFINES += -D_CARYLL_USE_PRE_SERIALIZED -DMAIN_VER=0 -DSECONDARY_VER=6 -DPATCH_VER=3 -DDEBUG -D_DEBUG
  INCLUDES += -I../../include
  FORCE_INCLUDE +=
  ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
  ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -std=gnu11 -Wall -Wno-multichar
  ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
  ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
  LIBS += bin/x64/Debug/liblibotfcc.a bin/x64/Debug/libdeps.a -lm
  LDDEPS += bin/x64/Debug/liblibotfcc.a bin/x64/Debug/libdeps.a
  ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64
  LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
  define PREBUILDCMDS
  endef
  define PRELINKCMDS
  endef
  define POSTBUILDCMDS
  endef
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
    @:

endif

ifeq ($(config),release_x32)
  RESCOMP = windres
  TARGETDIR = ../../bin/Release-x32
  TARGET = $(TARGETDIR)/otfccbuild
  OBJDIR = obj/x32/Release/otfccbuild
  DEFINES += -D_CARYLL_USE_PRE_SERIALIZED -DMAIN_VER=0 -DSECONDARY_VER=6 -DPATCH_VER=3 -DNDEBUG
  INCLUDES += -I../../include
  FORCE_INCLUDE +=
  ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
  ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O3 -std=gnu11 -Wall -Wno-multichar
  ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
  ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
  LIBS += bin/x32/Release/liblibotfcc.a bin/x32/Release/libdeps.a -lm
  LDDEPS += bin/x32/Release/liblibotfcc.a bin/x32/Release/libdeps.a
  ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -s
  LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
  define PREBUILDCMDS
  endef
  define PRELINKCMDS
  endef
  define POSTBUILDCMDS
  endef
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
    @:

endif

ifeq ($(config),release_x64)
  RESCOMP = windres
  TARGETDIR = ../../bin/Release-x64
  TARGET = $(TARGETDIR)/otfccbuild
  OBJDIR = obj/x64/Release/otfccbuild
  DEFINES += -D_CARYLL_USE_PRE_SERIALIZED -DMAIN_VER=0 -DSECONDARY_VER=6 -DPATCH_VER=3 -DNDEBUG
  INCLUDES += -I../../include
  FORCE_INCLUDE +=
  ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
  ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O3 -std=gnu11 -Wall -Wno-multichar
  ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
  ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
  LIBS += bin/x64/Release/liblibotfcc.a bin/x64/Release/libdeps.a -lm
  LDDEPS += bin/x64/Release/liblibotfcc.a bin/x64/Release/libdeps.a
  ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s
  LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
  define PREBUILDCMDS
  endef
  define PRELINKCMDS
  endef
  define POSTBUILDCMDS
  endef
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
    @:

endif

OBJECTS := \
    $(OBJDIR)/otfccbuild.o \
    $(OBJDIR)/stopwatch.o \

RESOURCES := \

CUSTOMFILES := \

SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
  SHELLTYPE := posix
endif
ifeq (/bin,$(findstring /bin,$(SHELL)))
  SHELLTYPE := posix
endif

$(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES)
    @echo Linking otfccbuild
    $(SILENT) $(LINKCMD)
    $(POSTBUILDCMDS)

$(TARGETDIR):
    @echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
    $(SILENT) mkdir -p $(TARGETDIR)
else
    $(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
endif

$(OBJDIR):
    @echo Creating $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
    $(SILENT) mkdir -p $(OBJDIR)
else
    $(SILENT) mkdir $(subst /,\\,$(OBJDIR))
endif

clean:
    @echo Cleaning otfccbuild
ifeq (posix,$(SHELLTYPE))
    $(SILENT) rm -f  $(TARGET)
    $(SILENT) rm -rf $(OBJDIR)
else
    $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
    $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif

prebuild:
    $(PREBUILDCMDS)

prelink:
    $(PRELINKCMDS)

ifneq (,$(PCH))
$(OBJECTS): $(GCH) $(PCH)
$(GCH): $(PCH)
    @echo $(notdir $<)
    $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
endif

$(OBJDIR)/otfccbuild.o: ../../src/otfccbuild.c
    @echo $(notdir $<)
    $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/stopwatch.o: ../../src/stopwatch.c
    @echo $(notdir $<)
    $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"

-include $(OBJECTS:%.o=%.d)
ifneq (,$(PCH))
  -include $(OBJDIR)/$(notdir $(PCH)).d
endif
be5invis commented 7 years ago

@S1ohy Can you build the release version?

make config=release_x64
S1ohy commented 7 years ago

@be5invis

I'm not sure, I'm a bit confused as to if this built or not:

[~/bin/otfcc-0.6.3/build/gmake]: make config=release_x64
==== Building deps (release_x64) ====
Creating bin/x64/Release
Creating obj/x64/Release/deps
emyg-dtoa.c
json-builder.c
json.c
sds.c
Linking deps
==== Building libotfcc (release_x64) ====
Creating obj/x64/Release/libotfcc
bkblock.c
bkgraph.c
consolidate.c
GDEF.c
chaining.c
common.c
gpos-cursive.c
gpos-pair.c
gpos-single.c
gsub-ligature.c
gsub-multi.c
gsub-reverse.c
gsub-single.c
mark.c
caryll-font.c
caryll-sfnt-builder.c
caryll-sfnt.c
json-reader.c
json-writer.c
cff-charset.c
cff-codecs.c
cff-dict.c
cff-fdselect.c
cff-index.c
cff-opmean.c
cff-parser.c
cff-string.c
cff-value.c
cff-writer.c
charstring-il.c
subr.c
logger.c
otf-reader.c
unconsolidate.c
otf-writer.c
stat.c
aglfn.c
base64.c
buffer.c
glyph-order.c
handle.c
json-ident.c
options.c
primitives.c
sha1.c
ttinstr.c
unicodeconv.c
BASE.c
CFF.c
COLR.c
CPAL.c
GDEF.c
LTSH.c
OS_2.c
SVG.c
../../lib/table/SVG.c: In function ‘otfcc_buildSVG’:
../../lib/table/SVG.c:129:12: warning: ‘main’ is usually a function [-Wmain]
  bk_Block *main = bk_new_Block(b16, svg.length, // numEntries
            ^~~~
VORG.c
cmap.c
cvt.c
fpgm-prep.c
gasp.c
glyf.c
hdmx.c
head.c
hhea.c
hmtx.c
maxp.c
name.c
build.c
classdef.c
constants.c
coverage.c
dump.c
otl.c
parse.c
read.c
build.c
classifier.c
common.c
dump.c
parse.c
read.c
extend.c
gpos-common.c
gpos-cursive.c
gpos-mark-to-ligature.c
gpos-mark-to-single.c
gpos-pair.c
gpos-single.c
gsub-ligature.c
gsub-multi.c
gsub-reverse.c
gsub-single.c
post.c
vhea.c
vmtx.c
functional.c
Linking libotfcc
==== Building otfccdump (release_x64) ====
Creating ../../bin/Release-x64
Creating obj/x64/Release/otfccdump
otfccdump.c
../../src/otfccdump.c: In function ‘main’:
../../src/otfccdump.c:57:7: warning: variable ‘no_bom’ set but not used [-Wunused-but-set-variable]
  bool no_bom = false;
       ^~~~~~
stopwatch.c
Linking otfccdump
==== Building otfccbuild (release_x64) ====
Creating obj/x64/Release/otfccbuild
otfccbuild.c
stopwatch.c
Linking otfccbuild
be5invis commented 7 years ago

This build is successed. In Release.

S1ohy commented 7 years ago

@be5invis Thank you. I might recommend putting config=release_x64 in the build instructions

be5invis commented 7 years ago

@S1ohy Sure. Closed.