From nalitoja@gmail.com  Thu Oct 13 22:30:24 2011
Return-Path: <nalitoja@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C2A51106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Oct 2011 22:30:24 +0000 (UTC)
	(envelope-from nalitoja@gmail.com)
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 573388FC1C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Oct 2011 22:30:24 +0000 (UTC)
Received: by bkbzx1 with SMTP id zx1so962205bkb.13
        for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Oct 2011 15:30:23 -0700 (PDT)
Received: by 10.204.136.16 with SMTP id p16mr4538216bkt.61.1318545023377;
        Thu, 13 Oct 2011 15:30:23 -0700 (PDT)
Received: from nil ([46.251.236.222])
        by mx.google.com with ESMTPS id d17sm6078261bkq.11.2011.10.13.15.30.14
        (version=SSLv3 cipher=OTHER);
        Thu, 13 Oct 2011 15:30:23 -0700 (PDT)
Message-Id: <86ty7cmspk.fsf@gmail.com>
Date: Thu, 13 Oct 2011 22:28:55 +0000
From: Nali Toja <nalitoja@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] games/el: clang build fails to link due to inlining

>Number:         161562
>Category:       ports
>Synopsis:       [patch] games/el: clang build fails to link due to inlining
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    acm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 13 22:40:06 UTC 2011
>Closed-Date:    Thu Oct 20 17:49:58 UTC 2011
>Last-Modified:  Thu Oct 20 17:49:58 UTC 2011
>Originator:     Nali Toja
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
>Description:
>How-To-Repeat:
$ make CC=clang CXX=clang++
[...]
  LINK el.x86
bags.o: In function `display_ground_items_handler':
bags.c:298: undefined reference to `get_items_texture'
cal.o: In function `cal_render_actor':
cal.c:709: undefined reference to `render_submesh'
cal.c:682: undefined reference to `render_submesh'
cal.c:686: undefined reference to `render_submesh'
cal.c:690: undefined reference to `render_submesh'
cal.c:717: undefined reference to `render_submesh'
hud.o: In function `display_quickbar_handler':
hud.c:1587: undefined reference to `get_items_texture'
manufacture.o: In function `display_manufacture_handler':
manufacture.c:117: undefined reference to `get_items_texture'
manufacture.c:154: undefined reference to `get_items_texture'
minimap.o: In function `draw_actor_points':
minimap.c:1165: undefined reference to `rotate_actor_points'
minimap.c:1262: undefined reference to `rotate_actor_points'
storage.o: In function `display_storage_handler':
storage.c:266: undefined reference to `get_items_texture'
trade.o: In function `display_trade_handler':
trade.c:104: undefined reference to `get_items_texture'
trade.c:142: undefined reference to `get_items_texture'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [el.x86] Error 1
>Fix:
--- clang.diff begins here ---
--- cal.c~
+++ cal.c
@@ -367,7 +367,7 @@ CHECK_GL_ERRORS();
 }
 
 
-__inline__ void render_submesh(int meshId, int submeshCount, struct CalRenderer * pCalRenderer, float meshVertices[30000][3], float meshNormals[30000][3], float meshTextureCoordinates[30000][2], CalIndex meshFaces[50000][3], Uint32 use_lightning, Uint32 use_textures)
+static __inline__ void render_submesh(int meshId, int submeshCount, struct CalRenderer * pCalRenderer, float meshVertices[30000][3], float meshNormals[30000][3], float meshTextureCoordinates[30000][2], CalIndex meshFaces[50000][3], Uint32 use_lightning, Uint32 use_textures)
 {
 	int submeshId;
 	int vertexCount=0;
--- items.h~
+++ items.h
@@ -159,7 +159,7 @@ int get_mouse_pos_in_grid(int mx, int my
  * \param no        id of the item
  * \retval GLuint   the texture id associated with \a no.
  */
-__inline__ GLuint get_items_texture(int no);
+extern __inline__ GLuint get_items_texture(int no);
 
 /*!
  * \ingroup items_window
--- minimap.c~
+++ minimap.c
@@ -1090,7 +1090,7 @@ static __inline__ float minimap_get_zoom
 	return zoom;
 }
 
-__inline__ void rotate_actor_points(float zoom_multip, float px, float py)
+static __inline__ void rotate_actor_points(float zoom_multip, float px, float py)
 {
 	float x,y;
 	x = (px - (float_minimap_size/2) ) + float_minimap_size/2;
--- clang.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->acm 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Oct 13 22:40:17 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161562 
State-Changed-From-To: open->closed 
State-Changed-By: acm 
State-Changed-When: Thu Oct 20 17:48:19 UTC 2011 
State-Changed-Why:  
- It could work with new version of el 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161562 
>Unformatted:
