dvdhrm / kmscon

Linux KMS/DRM based virtual Console Emulator
http://www.freedesktop.org/wiki/Software/kmscon
Other
433 stars 81 forks source link

Fix compile fail against recent mesa #40

Closed falconindy closed 11 years ago

falconindy commented 11 years ago

Hi David,

I wasn't able to compile kmscon against a recent git snapshot of mesa due to a supposedly missing symbol in libgbm. I traced it back to my own linker flags, which shouldn't be getting in the way of kmscon's conftest for gbm_bo_get_stride(). The attached patch resolves this.

dvdhrm commented 11 years ago

Hi Dave

Adding LDFLAGS makes sense here, but why did you remove the current cflags/libs from the temporary ones? Are you sure this works with cross-compiling? I know, I am just checking for a function-name, but it would be nice to get "config.log" with the gcc error message to see what we are fixing here.

Btw., I should really reverse the logic here because gbm_bo_get_pitch() shouldn't be used if this check fails as it was the old name.

Thanks! David

falconindy commented 11 years ago

Ah, apologies -- definitely should have included the failing compile:

configure:14277: checking for gbm_bo_get_stride in -lgbm
configure:14302: gcc -std=gnu99 -o conftest -march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4   -I/usr/include/libdrm    -Wl,--as-needed,-O1,--sort-common,-z,relro conftest.c -lgbm   -lgbm   -ldrm   >&5
/usr/lib/libkms.so.1: undefined reference to `drmGetCap'
/usr/lib/libkms.so.1: undefined reference to `drmCommandWrite'
/usr/lib/libkms.so.1: undefined reference to `drmCommandWriteRead'
/usr/lib/libkms.so.1: undefined reference to `drmIoctl'
collect2: error: ld returned 1 exit status

In the case of cross compiling, shouldn't the target CHOST be provided as part of $(CC) rather than $(CFLAGS)? I admit that I'm a little unfamiliar with cross compiling, but this has been my understanding (and why I removed the cflags/libs from the test).

dvdhrm commented 11 years ago

You are right. I picked up your patch (changed "buildsys:" to "build:") and pushed it as 0aa54a0a9848ddfe0eb49bdae8d27703c0a7a33b

Thanks! David

falconindy commented 11 years ago

Thanks for catching my typo and merging!