[LinuxPPS] 2.6.22...

Rodolfo Giometti giometti at enneenne.com
Mon Jul 30 17:36:32 CEST 2007


On Mon, Jul 30, 2007 at 04:44:08PM +0200, Udo van den Heuvel wrote:
> Udo van den Heuvel wrote:
> > Udo van den Heuvel wrote:
> > After rebuilding ntpd stuff now looks like it's starting to work under
> > 2.6.22.1 with ntp-pps 4.0.
> 
> Remaining issue is that when I *also* try to enable PPS via the ATOM
> (next to NMEA)  driver I get:
> 
> (........)
> gcc -m32 -march=i686 -mtune=c3-2 -pipe -mmmx -msse -fomit-frame-pointer
> -ffast-math -finline-functions -mfpmath=sse,387 -Os -pie -fPIE -Wall
> -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow
> -Wstrict-prototypes -o ntpd cmd_args.o ntp_config.o ntp_io.o ntpd.o
> ntpd-opts.o version.o  -L/usr/lib libntpd.a -lm -lcrypto
> ../libopts/.libs/libopts.a ../libntp/libntp.a -lcap
> libntpd.a(refclock_atom.o): In function `time_pps_destroy':
> refclock_atom.c:(.text+0x0): multiple definition of `time_pps_destroy'
> libntpd.a(refclock_nmea.o):refclock_nmea.c:(.text+0x0): first defined here
> libntpd.a(refclock_atom.o): In function `time_pps_kcbind':
> refclock_atom.c:(.text+0x186): multiple definition of `time_pps_kcbind'
> libntpd.a(refclock_nmea.o):refclock_nmea.c:(.text+0xca): first defined here
> [snip]
> refclock_atom.c:(.text+0x8d5): multiple definition of `time_pps_readlink'
> libntpd.a(refclock_nmea.o):refclock_nmea.c:(.text+0xa5e): first defined here
> collect2: ld returned 1 exit status
> make[3]: *** [ntpd] Error 1
> make[3]: Leaving directory `/usr/src/redhat/BUILD/ntp-4.2.4p2/ntpd'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/usr/src/redhat/BUILD/ntp-4.2.4p2/ntpd'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/src/redhat/BUILD/ntp-4.2.4p2'
> make: *** [all] Error 2
> error: Bad exit status from /var/tmp/rpm-tmp.19149 (%build)
> 
> 
> RPM build errors:
>     Bad exit status from /var/tmp/rpm-tmp.19149 (%build)
> 
> 
> Any ideas? (building just for ATOM works fine)

Please try the attached patch and report the results.

Thanks,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127
-------------- next part --------------
diff --git a/Documentation/pps/timepps.h b/Documentation/pps/timepps.h
index dee1782..0eccd05 100644
--- a/Documentation/pps/timepps.h
+++ b/Documentation/pps/timepps.h
@@ -81,8 +81,8 @@ typedef struct pps_params pps_params_t;
 
 #define PPS_HAVE_FINDSOURCE	1
 #define pps_min(a, b)		(a) < (b) ? a : b
-int time_pps_findsource(int index, char *path, int pathlen, char *idstring,
-			int idlen)
+static __inline int time_pps_findsource(int index, char *path, int pathlen,
+					char *idstring, int idlen)
 {
 	struct pps_source_data_s data;
 	int ret;
@@ -100,7 +100,8 @@ int time_pps_findsource(int index, char *path, int pathlen, char *idstring,
 }
 
 /* Defined iff PPS_HAVE_FINDPATH is defined */
-void time_pps_readlink(char *link, int linklen, char *path, int pathlen)
+static __inline void time_pps_readlink(char *link, int linklen, char *path,
+					int pathlen)
 {
 	int i;
 
@@ -116,7 +117,8 @@ void time_pps_readlink(char *link, int linklen, char *path, int pathlen)
 }
 
 #define PPS_HAVE_FINDPATH	1
-int time_pps_findpath(char *path, int pathlen, char *idstring, int idlen)
+static __inline int time_pps_findpath(char *path, int pathlen, char *idstring,
+					int idlen)
 {
 	struct pps_source_data_s data;
 	int ret;
@@ -132,7 +134,7 @@ int time_pps_findpath(char *path, int pathlen, char *idstring, int idlen)
 	return data.source;
 }
 
-int time_pps_create(int source, pps_handle_t *handle)
+static __inline int time_pps_create(int source, pps_handle_t *handle)
 {
 	if (!handle) {
 		errno = EINVAL;
@@ -147,14 +149,15 @@ int time_pps_create(int source, pps_handle_t *handle)
 	return 0;
 }
 
-int time_pps_destroy(pps_handle_t handle)
+static __inline int time_pps_destroy(pps_handle_t handle)
 {
 	/* Nothing to destroy here */
 
 	return 0;
 }
 
-int time_pps_getparams(pps_handle_t handle, pps_params_t *ppsparams)
+static __inline int time_pps_getparams(pps_handle_t handle,
+					pps_params_t *ppsparams)
 {
 	int ret;
 	struct pps_kparams __ppsparams;
@@ -171,7 +174,8 @@ int time_pps_getparams(pps_handle_t handle, pps_params_t *ppsparams)
 	return ret;
 }
 
-int time_pps_setparams(pps_handle_t handle, const pps_params_t *ppsparams)
+static __inline int time_pps_setparams(pps_handle_t handle,
+					const pps_params_t *ppsparams)
 {
 	struct pps_kparams __ppsparams;
 
@@ -186,13 +190,14 @@ int time_pps_setparams(pps_handle_t handle, const pps_params_t *ppsparams)
 }
 
 /* Get capabilities for handle */
-int time_pps_getcap(pps_handle_t handle, int *mode)
+static __inline int time_pps_getcap(pps_handle_t handle, int *mode)
 {
 	return syscall(__NR_time_pps_getcap, handle, mode);
 }
 
-int time_pps_fetch(pps_handle_t handle, const int tsformat,
-		   pps_info_t *ppsinfobuf, const struct timespec *timeout)
+static __inline int time_pps_fetch(pps_handle_t handle, const int tsformat,
+					pps_info_t *ppsinfobuf,
+					const struct timespec *timeout)
 {
 	struct pps_kinfo __ppsinfobuf;
 	struct pps_ktime __timeout;
@@ -223,8 +228,9 @@ int time_pps_fetch(pps_handle_t handle, const int tsformat,
 	return ret;
 }
 
-int time_pps_kcbind(pps_handle_t handle, const int kernel_consumer,
-		    const int edge, const int tsformat)
+static __inline int time_pps_kcbind(pps_handle_t handle,
+					const int kernel_consumer,
+					const int edge, const int tsformat)
 {
 	/* LinuxPPS doesn't implement kernel consumer feature */
 	errno = EOPNOTSUPP;


More information about the LinuxPPS mailing list