<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Geek in progress &#187; ptlsim</title>
	<atom:link href="http://www.itkovian.net/base/tag/ptlsim/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.itkovian.net/base</link>
	<description>I am not yet done.</description>
	<lastBuildDate>Thu, 20 Oct 2011 20:56:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PTLSim/KVM-QEMU on Ubuntu Karmic Koala</title>
		<link>http://www.itkovian.net/base/ptlsimkvm-qemu-on-ubuntu-karmic-koala/</link>
		<comments>http://www.itkovian.net/base/ptlsimkvm-qemu-on-ubuntu-karmic-koala/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 14:54:37 +0000</pubDate>
		<dc:creator>Itkovian</dc:creator>
				<category><![CDATA[research]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[koala]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[ptlsim]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.itkovian.net/base/?p=242</guid>
		<description><![CDATA[Ubuntu Karmic Koala comes with GCC 4.4.1, and the set of include files clashes a bit with what the KVM/QEMU port of PTLSim expects for its string library. Mostly, the issues involve missing 'const' modifiers to pointers. Here's a diff though.]]></description>
			<content:encoded><![CDATA[<p>Ubuntu Karmic Koala comes with GCC 4.4.1, and the set of include files clashes a bit with what the KVM/QEMU port of PTLSim expects for its string library. Mostly, the issues involve missing &#8216;const&#8217; modifiers to pointers. Here&#8217;s a diff though.<br />
<!--break--></p>
<div class="code">
diff &#8211;git a/Makefile b/Makefile<br />
index a0c25f4..87d70d6 100644<br />
&#8212; a/Makefile<br />
+++ b/Makefile<br />
@@ -56,7 +56,7 @@ BUILDHOST = $(shell hostname -f)<br />
 BUILDUSER = $(USER)</p>
<p> CC = g++<br />
-CFLAGS = -O99 -g3 -fpic -march=core2 -falign-functions=16 -funit-at-a-time -minline-all-stringops -fno-trapping-math -fno-exceptions -fno-rtti -mpreferred-stack-boundary=4 -fno-strict-aliasing -Wreturn-type -mno-red-zone<br />
+CFLAGS = -O99 -g3 -fpic -march=core2 -falign-functions=16 -funit-at-a-time -minline-all-stringops -fno-trapping-math -fno-exceptions -fno-rtti -mpreferred-stack-boundary=4 -fno-strict-aliasing -Wreturn-type -mno-red-zone -fno-stack-protector<br />
 KVMVER = 86<br />
 QEMUDIR = ../qemu-kvm-ptlsim<br />
 INCFLAGS = -Iinclude -I. -I$(QEMUDIR)/kvm/include -I$(QEMUDIR)/kvm/include/x86 -DPTLSIM_HYPERVISOR -DPTLSIM_KVM -D__INSIDE_PTLSIM__ \<br />
diff &#8211;git a/lib/klibc.cpp b/lib/klibc.cpp<br />
index ae0f75b..3b5c5c0 100644<br />
&#8212; a/lib/klibc.cpp<br />
+++ b/lib/klibc.cpp<br />
@@ -842,7 +842,7 @@ int strncmp(const char *cs, const char *ct, size_t count)<br />
  * @s: The string to be searched<br />
  * @c: The character to search for<br />
  */<br />
-char *strchr(const char *s, int c)<br />
+const char *strchr(const char *s, int c)<br />
 {<br />
 	for (; *s != (char)c; ++s)<br />
 		if (*s == &#8216;\0&#8242;)<br />
@@ -858,7 +858,7 @@ char *strchr(const char *s, int c)<br />
  * @s: The string to be searched<br />
  * @c: The character to search for<br />
  */<br />
-char *strrchr(const char *s, int c)<br />
+const char *strrchr(const char *s, int c)<br />
 {<br />
        const char *p = s + strlen(s);<br />
        do {<br />
@@ -877,7 +877,7 @@ char *strrchr(const char *s, int c)<br />
  * @count: The number of characters to be searched<br />
  * @c: The character to search for<br />
  */<br />
-char *strnchr(const char *s, size_t count, int c)<br />
+const char *strnchr(const char *s, size_t count, int c)<br />
 {<br />
 	for (; count&#8211; &#038;&#038; *s != &#8216;\0&#8242;; ++s)<br />
 		if (*s == (char)c)<br />
@@ -976,7 +976,7 @@ size_t strcspn(const char *s, const char *reject)<br />
  * @cs: The string to be searched<br />
  * @ct: The characters to search for<br />
  */<br />
-char *strpbrk(const char *cs, const char *ct)<br />
+const char *strpbrk(const char *cs, const char *ct)<br />
 {<br />
 	const char *sc1, *sc2;</p>
<p>@@ -1146,7 +1146,7 @@ void *memscan(void *addr, int c, size_t size)<br />
  * @s1: The string to be searched<br />
  * @s2: The string to search for<br />
  */<br />
-char *strstr(const char *s1, const char *s2)<br />
+const char *strstr(const char *s1, const char *s2)<br />
 {<br />
 	int l1, l2;</p>
<p>@@ -1175,7 +1175,7 @@ char *strstr(const char *s1, const char *s2)<br />
  * returns the address of the first occurrence of @c, or %NULL<br />
  * if @c is not found<br />
  */<br />
-void *memchr(const void *s, int c, size_t n)<br />
+const void *memchr(const void *s, int c, size_t n)<br />
 {<br />
 	const unsigned char *p = (unsigned char*)s;<br />
 	while (n&#8211; != 0) {
</p></div>
<p>As you can tell, the CFLAGS definition in the Makefile was also extended with &#8220;-fno-stack-protector&#8221;, as the build with otherwise fail with a few <i>undefined reference to `__stack_chk_fail&#8217;</i> errors, see also <a href="http://lkml.org/lkml/2006/7/28/161">this lkml entry</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itkovian.net/base/ptlsimkvm-qemu-on-ubuntu-karmic-koala/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

