注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

一路

To find the final symmetry & beauty

 
 
 

日志

 
 
 
 

How to build gcc plugin on Mac OSX 10.7 lion system[origin]  

2012-04-23 17:30:06|  分类: 共享 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
        If you were using the parameters used on linux from gcc internal manual, you would suffer the errors similar to the following depended on the plugin API you called.  To solve the problem you should add several command line option to gcc compiler

Undefined symbols for architecture x86_64:
  "_vec_heap_p_reserve", referenced from:
      _VEC_tree_heap_reserve in tree_printer_main.o
  "_tree_code_type", referenced from:
      _genericize_if_stmt in tree_printer_main.o
      _cp_genericize_r in tree_printer_main.o
      _dequeue_and_dump in my-tree-dump.o
  "_build_empty_stmt", referenced from:
      _genericize_if_stmt in tree_printer_main.o
  "_integer_nonzerop", referenced from:
      _genericize_if_stmt in tree_printer_main.o
  "_integer_zerop", referenced from:
      _genericize_if_stmt in tree_printer_main.o
  "_global_trees", referenced from:
      _genericize_if_stmt in tree_printer_main.o
      _cp_genericize_r in tree_printer_main.o
      _dequeue_and_dump in my-tree-dump.o
  "_build3_stat", referenced from:
      _genericize_if_stmt in tree_printer_main.o

I have found solution on this web address
http://sourceforge.net/news/?group_id=180190
in my Makefile to compile plugin, I just add this definition to compiler

CC_FLAGS = -v -dynamiclib -undefined dynamic_lookup
I tried to search around and finally found the following explanation from apple website, 

-dynamic is a flag that both gcc and ld accept. gcc just passes it straight on to ld. It tells ld to build a dyanmically linked executable, as opposed to a statically linked one. It's turned on by default -- in fact, I don't think there's any official support for static executables on Darwin.

-dynamiclib is a gcc flag.  It tells gcc to pass -dylib to ld.

-dylib is an ld flag.  It tells ld to build a Mach-O dynamic shared library.

I think this would be helpful to those wanting to develop GCC plugin on Mac system.
  评论这张
 
阅读(650)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017