:: Re: [DNG] Packaging Vdev - compilat…
Kezdőlap
Delete this message
Reply to this message
Szerző: Didier Kryn
Dátum:  
Címzett: dng
Régi témák: Re: [DNG] Packaging Vdev
Tárgy: Re: [DNG] Packaging Vdev - compilation errors and patch
Le 21/03/2016 16:12, shraptor a écrit :
> On 2016-03-21 16:04, shraptor wrote:
>> On 2016-03-20 20:57, Didier Kryn wrote:
>>> Le 20/03/2016 19:14, shraptor a écrit :
>>>>>
>>>>> I expect Jude has tested his last version and I suspect he did it
>>>>> with
>>>>> the files under /usr/local and it worked. On my side, I tested it
>>>>> under the FHS but with a different OS and it failed. I dunno where
>>>>> the
>>>>> error is. One possibility is that the problem is in the misplacement
>>>>> of some file(s) or error in some config file.
>>>>
>>>>
>>>> What error, what happens or is it merely not working?
>>>> Did you check log-files?
>>>
>>>     The disks are not detected. They were in pretty all earlier
>>> versions. The log is really HUGE and detecting errors in it is
>>> difficult. If you're used to it, I can send it to you.

>>>
>>>>
>>>> Latest version works for me under Arch based OS although there are
>>>> some
>>>> question marks for me regarding using vdev and devtmpfs together
>>>> but I have open
>>>> issues on github for those.
>>>
>>>     I'm surprised because I had to fix some source files to be able to
>>> compile it.

>>
>>
>> Now you got me interested, do you remember which ones?
>
> To be sure I just cloned vdev from git and compiled == worked.


     I also have an unsoved problem with fs, but let's ignore it for now 
because fs is only a goodie.


Here is the compilation error:


kryn@apcnb98:~/Applications/vdev-plus/vdev$ gcc --version
gcc (Debian 4.6.3-14) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
kryn@apcnb98:~/Applications/vdev-plus/vdev$ make -C vdevd
[...]
/home/kryn/Applications/vdev-plus/vdev/build/sbin/device.o: In function
`vdev_device_request_to_env':
/home/kryn/Applications/vdev-plus/vdev/vdevd/device.c:257: undefined
reference to `major'
/home/kryn/Applications/vdev-plus/vdev/vdevd/device.c:268: undefined
reference to `minor'
/home/kryn/Applications/vdev-plus/vdev/build/sbin/device.o: In function
`vdev_device_add':
/home/kryn/Applications/vdev-plus/vdev/vdevd/device.c:863: undefined
reference to `minor'
/home/kryn/Applications/vdev-plus/vdev/vdevd/device.c:863: undefined
reference to `major'
... same for several functions.

This is corrected by my first patch, include-sysmacros.diff
The two other patches allow the user to provide additional CFLAGS and/or
LDFLAGS to better control building, for example to build statically or
to provide librabies in non-standard places.

     Didier

diff -rupN vdev/vdevd/device.h vdev-patched/vdevd/device.h
--- vdev/vdevd/device.h    2016-02-14 18:37:43.812467331 +0100
+++ vdev-patched/vdevd/device.h    2016-02-14 18:13:23.561888936 +0100
@@ -22,6 +22,7 @@
 #ifndef _VDEV_DEVICE_H_
 #define _VDEV_DEVICE_H_


+#include <sys/sysmacros.h>
#include "libvdev/util.h"
#include "libvdev/param.h"
#include "workqueue.h"
@@ -110,4 +111,4 @@ int vdev_device_remove( struct vdev_devi

C_LINKAGE_END

-#endif
\ No newline at end of file
+#endif
diff -rupN vdev/buildconf.mk vdev-patched/buildconf.mk
--- vdev/buildconf.mk    2016-02-14 18:37:43.756466570 +0100
+++ vdev-patched/buildconf.mk    2016-02-18 11:14:41.604940408 +0100
@@ -69,7 +69,7 @@ BUILD_HWDB_DIRS := $(BUILD_HWDB)
 INSTALL_HWDB := $(DESTDIR)$(LIBDIR)/vdev/hwdb


 # compiler
-CFLAGS     := -Wall -std=c99 -g -fPIC -fstack-protector -fstack-protector-all -pthread -Wno-unused-variable -Wno-unused-but-set-variable
+override CFLAGS += -Wall -std=c99 -g -fPIC -fstack-protector -fstack-protector-all -pthread -Wno-unused-variable -Wno-unused-but-set-variable
 LDFLAGS    :=
 INC      := -I. -I$(ROOT_DIR) -I$(BUILD_INCLUDEDIR)
 DEFS     := -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_VDEV_OS_$(OS) -D_XOPEN_SOURCE=700

Binary files vdev/.git/index and vdev-patched/.git/index differ
diff -rupN vdev/vdevd/helpers/LINUX/Makefile vdev-patched/vdevd/helpers/LINUX/Makefile
--- vdev/vdevd/helpers/LINUX/Makefile    2015-06-02 21:19:21.631510039 +0200
+++ vdev-patched/vdevd/helpers/LINUX/Makefile    2015-06-02 21:14:52.000000000 +0200
@@ -15,7 +15,7 @@ all: $(HELPERS_BUILD)


 $(BUILD_VDEVD_HELPERS)/%: $(BUILD_VDEVD_HELPERS)/%.o $(BUILD_VDEVD_HELPERS)/common.o
     @mkdir -p $(shell dirname "$@")
-    $(CC) -o $@ $< $(BUILD_VDEVD_HELPERS)/common.o $(LIBINC) $(LIB)
+    $(CC) -o $@ $< $(BUILD_VDEVD_HELPERS)/common.o $(LIBINC) $(LIB) $(LDFLAGS)


 $(BUILD_VDEVD_HELPERS)/%.o: %.c
     @mkdir -p $(shell dirname "$@")