Native objects '/usr/local/lib/libgq.a' detected in the link. To allow, specify --pnacl-allow-native

105 views
Skip to first unread message

firebird

unread,
Apr 6, 2017, 10:25:23 AM4/6/17
to Native-Client-Discuss
Error running objdump on: /opt/google/chrome/chrome
  LINK pnacl/Release/url_loader_unstripped.bc
pnacl-ld: Native objects '/usr/local/lib/libgq.a' detected in the link. To allow, specify --pnacl-allow-native
Makefile:31: recipe for target 'pnacl/Release/url_loader_unstripped.bc' failed
make: *** [pnacl/Release/url_loader_unstripped.bc] Error 255

how to add flags  --pnacl-allow-native in makefile

firebird

unread,
Apr 6, 2017, 10:27:19 AM4/6/17
to Native-Client-Discuss
Makefile:
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# GNU Makefile based on shared rules provided by the Native Client SDK.
# See README.Makefiles for more details.

VALID_TOOLCHAINS := pnacl glibc clang-newlib linux

NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../../..)

TARGET = url_loader


include $(NACL_SDK_ROOT)/tools/common.mk

LDFLAGS = -L/usr/local/lib -lgq      //link with third party lib
LIBS = ppapi_cpp ppapi pthread

CFLAGS = -Wall -I/usr/local/include   //third party lib headers
SOURCES = url_loader.cc \
  url_loader_handler.cc

# Build rules generated by macros from common.mk:

$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))

# The PNaCl workflow uses both an unstripped and finalized/stripped binary.
# On NaCl, only produce a stripped binary for Release configs (not Debug).
ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG))))
$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
else
$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
endif

$(eval $(call NMF_RULE,$(TARGET),))


在 2017年4月6日星期四 UTC+8下午10:25:23,firebird写道:

firebird

unread,
Apr 6, 2017, 10:29:02 AM4/6/17
to Native-Client-Discuss
when add  --pnacl-allow-native in the VALID_TOOLS_CHAINS,there is another error:
Error running objdump on: /opt/google/chrome/chrome
  CXX  pnacl/Release/url_loader.o
pnacl-opt: /home/henryzhu/workspace/nacl_sdk/pepper_49/examples/api/url_loader/pnacl/Release/url_loader.o---url_loader.cc---.expand.po: Trying to convert bitcode to an object file before bitcode linking. This is supposed to wait until translation. Use --pnacl-allow-translate to override.
Makefile:26: recipe for target 'pnacl/Release/url_loader.o' failed
make: *** [pnacl/Release/url_loader.o] Error 255

and the Makefile:
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# GNU Makefile based on shared rules provided by the Native Client SDK.
# See README.Makefiles for more details.

VALID_TOOLCHAINS := pnacl --pnacl-allow-native glibc clang-newlib linux

NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../../..)

TARGET = url_loader


include $(NACL_SDK_ROOT)/tools/common.mk

LDFLAGS = -L/usr/local/lib -lgq
LIBS = ppapi_cpp ppapi pthread

CFLAGS = -Wall -I/usr/local/include
SOURCES = url_loader.cc \
  url_loader_handler.cc

# Build rules generated by macros from common.mk:

$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))

# The PNaCl workflow uses both an unstripped and finalized/stripped binary.
# On NaCl, only produce a stripped binary for Release configs (not Debug).
ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG))))
$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
else
$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
endif

$(eval $(call NMF_RULE,$(TARGET),))


在 2017年4月6日星期四 UTC+8下午10:25:23,firebird写道:
Error running objdump on: /opt/google/chrome/chrome

Sam Clegg

unread,
Apr 7, 2017, 1:34:22 PM4/7/17
to native-cli...@googlegroups.com
You can't link native libraries into PNaCl executables. If you want
to this library (libgq) you would need to compile to with the PNaCl
toolchain first. I good place to start if you want to port a new
library to PNaCl is https://chromium.googlesource.com/webports.
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.
> To post to this group, send email to native-cli...@googlegroups.com.
> Visit this group at https://groups.google.com/group/native-client-discuss.
> For more options, visit https://groups.google.com/d/optout.

朱小江

unread,
Apr 10, 2017, 1:58:50 AM4/10/17
to native-cli...@googlegroups.com
Thanks for you response. 
Your idea should be helpful, i'am trying on it. If there is any progress, i'll let you know. 😀😀😀

--
You received this message because you are subscribed to a topic in the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/native-client-discuss/XYi647I2eWg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to native-client-discuss+unsub...@googlegroups.com.
To post to this group, send email to native-client-discuss@googlegroups.com.

朱小江

unread,
Apr 15, 2017, 12:27:44 PM4/15/17
to native-cli...@googlegroups.com
Dear Sam,

Follow your instruction, the issue got some progress in these days. But, there is a new issue confuse me for many days, hope you can help me to solve it. 
the issue url is: 

many thanks in advanced. 
I looking forward your reply.
😂😂😂



> To post to this group, send email to native-client-discuss@googlegroups.com.
> Visit this group at https://groups.google.com/group/native-client-discuss.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/native-client-discuss/XYi647I2eWg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to native-client-discuss+unsubscri...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages