git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Make git compile with SUNs forte12 compiler

From
MCmatthieu castet <castet.matthieu@free.fr>
Date
May 13, 2007, 12:52 UTC
Message-ID
<46470A25.70703@free.fr>
In-Reply-To
<20070513103038.GC18546@cip.informatik.uni-erlangen.de>
Hi Thomas,
Thomas Glanzmann wrote:
Show 10 quoted lines
> Hello,
> 
> [ Junio please drop the patch, if you thought about putting it upstream ]
> 
>> Did you understand what you did ?
> 
> I do. But my objective wasn't get that function inline but get git to compile
> under forte12. However. After you pushed me in the right direction I read the
> compiler documentation and found a compiler option called "-features=no%extinl"
> which makes it possible to compile git as is using forte12.

What's strange with your compiler is that it seems to not take care of the "static" keyword and thinks about an "extern inline". Now it could be interesting to understand why.

Let's look at your error [1]. First it only complain about tree_entry_extract not tree_entry_len.

Let's see why ? If you look in tree-walk.h and search for tree_entry_extract, you will see :

static inline const unsigned char *tree_entry_extract(struct tree_desc *desc, const char **pathp, unsigned int *modep) [...] const unsigned char *tree_entry_extract(struct tree_desc *, const char **, unsigned int *);

This is bad, tree_entry_extract is declared as static inline and as extern.

If you remove the "const unsigned char *tree_entry_extract(struct tree_desc *, const char **, unsigned int *);", I bet everybody will be happy and no need to extra option for the sun compiler. [2]

Matthieu
[1]
LINK git-convert-objects
ld: fatal: symbol `tree_entry_extract' is multiply-defined:
         (file libgit.a(sha1_name.o) type=FUNC; file libgit.a(tree.o) 
type=FUNC);
ld: fatal: symbol `tree_entry_extract' is multiply-defined:
         (file libgit.a(sha1_name.o) type=FUNC; file 
libgit.a(tree-walk.o) type=FUNC);
ld: fatal: File processing errors. No output written to git-convert-objects
[2] see attached patch
--- a/tree-walk.h	2007-05-13 14:51:01.451827585 +0200
+++ b/tree-walk.h	2007-05-13 14:51:07.450235889 +0200
@@ -27,7 +27,6 @@
 
 void update_tree_entry(struct tree_desc *);
 void init_tree_desc(struct tree_desc *desc, const void *buf, unsigned long size);
-const unsigned char *tree_entry_extract(struct tree_desc *, const char **, unsigned int *);
 
 /* Helper function that does both of the above and returns true for success */
 int tree_entry(struct tree_desc *, struct name_entry *);
Previous: Thomas GlanzmannNext: Johannes Schindelin
Message 4 of 6 in “Make git compile with SUNs forte12 compiler”
  1. Make git compile with SUNs forte12 compilerThomas Glanzmann, May 12, 2007
  2. Matthieu CASTETMay 13, 2007
  3. Thomas GlanzmannMay 13, 2007
  4. matthieu castetMay 13, 2007
  5. Johannes SchindelinMay 13, 2007
  6. Thomas GlanzmannMay 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.