lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120108090018.GB7168@elte.hu>
Date:	Sun, 8 Jan 2012 10:00:19 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Namhyung Kim <namhyung@...il.com>
Cc:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>, linux-kernel@...r.kernel.org
Subject: Re: [ERROR] perf build failure on current tip:perf/core


* Namhyung Kim <namhyung@...il.com> wrote:

> Hi,
> 
> When I tried to build perf, I was faced with following error:
> 
>     CC util/trace-event-info.o
> cc1: warnings being treated as errors
> util/trace-event-info.c: In function ‘record_file’:
> util/trace-event-info.c:192: error: implicit declaration of function
> ‘pwrite’
> util/trace-event-info.c:192: error: nested extern declaration of
> ‘pwrite’
> make: *** [util/trace-event-info.o] Error 1
> 
> The code I tried was latest tip:perf/core - 9e183426bfb5 ("perf kvm: Fix
> copy & paste error in description") and code in mainline (v3.2) doesn't
> have this problem. Looking at the code, I couldn't find any clue to
> this. Any idea?
> 
> FYI, my system is Ubuntu 10.04 on x86_64. gcc version is 4.4.3:

Which header does pwrite() belong to on that system - what does 
'map pwrite' say? It ought to be unistd.h, which is directly 
included in util/trace-event-info.c.

My guess is that it might be related to:

tools/perf/Makefile:ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64

Which introduces pwrite64() and defines pwrite() to them.

Does the patch below help? It's only a workaround really as 
pwrite() ought to exist ... Also, i have only tested this on 
64-bit.

Thanks,

	Ingo

diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index ac6830d..ba8b024 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -189,7 +189,7 @@ static void record_file(const char *file, size_t hdr_sz)
 	if (bigendian())
 		sizep += sizeof(u64) - hdr_sz;
 
-	if (hdr_sz && pwrite(output_fd, sizep, hdr_sz, hdr_pos) < 0)
+	if (hdr_sz && pwrite64(output_fd, sizep, hdr_sz, hdr_pos) < 0)
 		die("writing to %s", output_file);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ