diff options
32 files changed, 488 insertions, 221 deletions
diff --git a/erl-build-tool-vars.sh b/erl-build-tool-vars.sh index c6f25d7f79..f66dc2d286 100644 --- a/erl-build-tool-vars.sh +++ b/erl-build-tool-vars.sh @@ -25,4 +25,4 @@ # When updating, also update $ERL_TOP/xcomp/{README,erl-xcomp.conf.template}, # and precious variables in $ERL_TOP/erts/aclocal.m4. # -erl_build_tool_vars="CC CFLAGS STATIC_CFLAGS CFLAG_RUNTIME_LIBRARY_PATH CPP CPPFLAGS CXX CXXFLAGS LD LDFLAGS DED_LD DED_LDFLAGS DED_LD_FLAG_RUNTIME_LIBRARY_PATH RANLIB AR" +erl_build_tool_vars="CC CFLAGS STATIC_CFLAGS CFLAG_RUNTIME_LIBRARY_PATH CPP CPPFLAGS CXX CXXFLAGS LD LDFLAGS LIBS DED_LD DED_LDFLAGS DED_LD_FLAG_RUNTIME_LIBRARY_PATH LFS_CFLAGS LFS_LDFLAGS LFS_LIBS RANLIB AR GETCONF" diff --git a/erts/aclocal.m4 b/erts/aclocal.m4 index 8002ed3d34..8052b2d67d 100644 --- a/erts/aclocal.m4 +++ b/erts/aclocal.m4 @@ -42,11 +42,16 @@ AC_ARG_VAR(CXX, [C++ compiler]) AC_ARG_VAR(CXXFLAGS, [C++ compiler flags]) AC_ARG_VAR(LD, [linker (is often overridden by configure)]) AC_ARG_VAR(LDFLAGS, [linker flags (can be risky to set since LD may be overriden by configure)]) +AC_ARG_VAR(LIBS, [libraries]) AC_ARG_VAR(DED_LD, [linker for Dynamic Erlang Drivers (set all DED_LD* variables or none)]) AC_ARG_VAR(DED_LDFLAGS, [linker flags for Dynamic Erlang Drivers (set all DED_LD* variables or none)]) AC_ARG_VAR(DED_LD_FLAG_RUNTIME_LIBRARY_PATH, [runtime library path linker flag for Dynamic Erlang Drivers (set all DED_LD* variables or none)]) +AC_ARG_VAR(LFS_CFLAGS, [large file support C compiler flags (set all LFS_* variables or none)]) +AC_ARG_VAR(LFS_LDFLAGS, [large file support linker flags (set all LFS_* variables or none)]) +AC_ARG_VAR(LFS_LIBS, [large file support libraries (set all LFS_* variables or none)]) AC_ARG_VAR(RANLIB, [ranlib]) AC_ARG_VAR(AR, [ar]) +AC_ARG_VAR(GETCONF, [getconf]) dnl Cross system root AC_ARG_VAR(erl_xcomp_sysroot, [Absolute cross system root path (only used when cross compiling)]) @@ -82,6 +87,29 @@ else fi ]) +AC_DEFUN(LM_CHECK_GETCONF, +[ +if test "$cross_compiling" != "yes"; then + AC_CHECK_PROG([GETCONF], [getconf], [getconf], [false]) +else + dnl First check if we got a `<HOST>-getconf' in $PATH + host_getconf="$host_alias-getconf" + AC_CHECK_PROG([GETCONF], [$host_getconf], [$host_getconf], [false]) + if test "$GETCONF" = "false" && test "$erl_xcomp_sysroot" != ""; then + dnl We should perhaps give up if we have'nt found it by now, but at + dnl least in one Tilera MDE `getconf' under sysroot is a bourne + dnl shell script which we can use. We try to find `<HOST>-getconf' + dnl or `getconf' under sysconf, but only under sysconf since + dnl `getconf' in $PATH is almost guaranteed to be for the build + dnl machine. + GETCONF= + prfx="$erl_xcomp_sysroot" + AC_PATH_TOOL([GETCONF], [getconf], [false], + ["$prfx/usr/bin:$prfx/bin:$prfx/usr/local/bin"]) + fi +fi +]) + dnl ---------------------------------------------------------------------- dnl dnl LM_FIND_EMU_CC @@ -533,19 +561,22 @@ dnl On ofs1 the '-pthread' switch should be used linux*) THR_DEFS="$THR_DEFS -D_POSIX_THREAD_SAFE_FUNCTIONS" + LM_CHECK_GETCONF AC_MSG_CHECKING(for Native POSIX Thread Library) - if test X$cross_compiling = Xyes; then - case X$erl_xcomp_linux_nptl in - X) nptl=cross;; - Xyes|Xno) nptl=$erl_xcomp_linux_nptl;; + libpthr_vsn=`$GETCONF GNU_LIBPTHREAD_VERSION 2>/dev/null` + if test $? -eq 0; then + case "$libpthr_vsn" in + *nptl*|*NPTL*) nptl=yes;; + *) nptl=no;; + esac + elif test "$cross_compiling" = "yes"; then + case "$erl_xcomp_linux_nptl" in + "") nptl=cross;; + yes|no) nptl=$erl_xcomp_linux_nptl;; *) AC_MSG_ERROR([Bad erl_xcomp_linux_nptl value: $erl_xcomp_linux_nptl]);; esac else - case `getconf GNU_LIBPTHREAD_VERSION 2>/dev/null` in - nptl*) nptl=yes;; - NPTL*) nptl=yes;; - *) nptl=no;; - esac + nptl=no fi AC_MSG_RESULT($nptl) if test $nptl = cross; then diff --git a/erts/configure.in b/erts/configure.in index a9df8980c1..a3b6fe319f 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -448,22 +448,59 @@ case $host_os in ;; esac +lfs_conf=ok +lfs_source=none +if test "${LFS_CFLAGS+set}" = "set" || \ + test "${LFS_LDFLAGS+set}" = "set" || \ + test "${LFS_LIBS+set}" = "set"; then + lfs_source=user +else + LM_CHECK_GETCONF + test "$GETCONF" = "false" || lfs_source=getconf +fi -dnl -dnl Use the getconf utility if it exists -dnl to find large file support flags. -dnl -if type getconf >/dev/null 2>&1; then - CFLAGS="$CFLAGS `getconf LFS_CFLAGS 2>/dev/null`" - DEBUG_CFLAGS="$DEBUG_CFLAGS `getconf LFS_CFLAGS 2>/dev/null`" - LDFLAGS="$LDFLAGS `getconf LFS_LDFLAGS 2>/dev/null`" - LIBS="$LIBS `getconf LFS_LIBS 2>/dev/null`" +if test "$lfs_source" = "none"; then + AC_MSG_WARN([Do not know how to check for large file support flags; no getconf is available]) +else + for var in CFLAGS LDFLAGS LIBS; do + AC_MSG_CHECKING([for large file support $var]) + if test $lfs_source = user; then + eval "lfs_val=\"\$LFS_$var\"" + else + eval "lfs_var=LFS_$var" + lfs_val=`$GETCONF $lfs_var 2>/dev/null` || lfs_conf=failed + if test $lfs_conf = failed; then + AC_MSG_RESULT([failed]) + break + fi + eval "$lfs_var=\"$lfs_val\"" + fi + test "$lfs_val" != "" || lfs_val=none + AC_MSG_RESULT([$lfs_val]) + done + if test $lfs_conf = failed; then + AC_MSG_WARN([Check for large file support flags failed; $GETCONF failed]) + else + CFLAGS="$CFLAGS $LFS_CFLAGS" + DEBUG_CFLAGS="$DEBUG_CFLAGS $LFS_CFLAGS" + LDFLAGS="$LDFLAGS $LFS_LDFLAGS" + LIBS="$LIBS $LFS_LIBS" + fi fi if test "x$GCC" = xyes; then # until the emulator can handle this, I suggest we turn it off! #WFLAGS="-Wall -Wshadow -Wcast-qual -Wmissing-declarations" - WFLAGS="-Wall -Wstrict-prototypes -Wmissing-prototypes" + WFLAGS="-Wall -Wstrict-prototypes" + + case "$host_cpu" in + tile*) + # tile-gcc is a bit stricter with -Wmissing-prototypes than other gccs, + # and too strict for our taste. + ;; + *) + WFLAGS="$WFLAGS -Wmissing-prototypes";; + esac saved_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wdeclaration-after-statement" @@ -663,7 +700,7 @@ fi AC_PROG_LN_S -AC_CHECK_PROG(AR, ar, ar, false) +AC_CHECK_TOOL([AR], [ar], [false]) if test "$ac_cv_prog_AR" = false; then AC_MSG_ERROR([No 'ar' command found in PATH]) fi diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index 97c21ce28f..2fe12be43e 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -609,7 +609,7 @@ endif ifneq ($(filter tile-%,$(TARGET)),) $(OBJDIR)/beam_emu.o: beam/beam_emu.c - $(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) \ + $(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) \ -OPT:Olimit=0 -WOPT:lpre=off:spre=off:epre=off \ $(INCLUDES) -c $< -o $@ endif @@ -1089,8 +1089,16 @@ DEP_FLAGS=-MM $(subst -O2,,$(CFLAGS)) $(INCLUDES) -I../etc/win32 -Idrivers/comm # SYS_SRC=$(subst sys/common/erl_poll.c,,$(ALL_SYS_SRC)) else # !win32 + +ifeq ($(findstring tile,$(TARGET)),tile) +# tile-gcc doesn't like -MG +MG_FLAG= +else +MG_FLAG=-MG +endif + DEP_CC=$(CC) -DEP_FLAGS=-MM -MG $(CFLAGS) $(INCLUDES) -Idrivers/common +DEP_FLAGS=-MM $(MG_FLAG) $(CFLAGS) $(INCLUDES) -Idrivers/common SYS_SRC=$(ALL_SYS_SRC) endif diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index 9c8c0df9f0..1b670585a7 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -4143,6 +4143,7 @@ BIF_RETTYPE blocking_read_file_1(BIF_ALIST_1) FILE *file; struct stat file_info; char *filename = NULL; + size_t size; i = list_length(BIF_ARG_1); if (i < 0) { @@ -4170,9 +4171,13 @@ BIF_RETTYPE blocking_read_file_1(BIF_ALIST_1) fclose(file); BIF_RET(TUPLE2(hp, am_error, am_allocator)); } - fread(buff, 1, buff_size, file); + size = fread(buff, 1, buff_size, file); fclose(file); - bin = new_binary(BIF_P, buff, buff_size); + if (size < 0) + size = 0; + else if (size > buff_size) + size = (size_t) buff_size; + bin = new_binary(BIF_P, buff, (int) size); erts_free(ERTS_ALC_T_TMP, (void *) buff); BIF_RET(TUPLE2(hp, am_ok, bin)); diff --git a/erts/emulator/beam/erl_binary.h b/erts/emulator/beam/erl_binary.h index dc5539faad..f8ecdde997 100644 --- a/erts/emulator/beam/erl_binary.h +++ b/erts/emulator/beam/erl_binary.h @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2000-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2000-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -265,13 +265,13 @@ erts_bin_free(Binary *bp) ERTS_GLB_INLINE Binary * erts_create_magic_binary(Uint size, void (*destructor)(Binary *)) { - Uint bsize = sizeof(Binary) - 1 + sizeof(ErtsBinaryMagicPart) - 1 + size; + Uint bsize = ERTS_MAGIC_BIN_SIZE(size); Binary* bptr = erts_alloc_fnf(ERTS_ALC_T_BINARY, bsize); if (!bptr) erts_alloc_n_enomem(ERTS_ALC_T2N(ERTS_ALC_T_BINARY), bsize); ERTS_CHK_BIN_ALIGNMENT(bptr); bptr->flags = BIN_FLAG_MAGIC; - bptr->orig_size = sizeof(ErtsBinaryMagicPart) - 1 + size; + bptr->orig_size = ERTS_MAGIC_BIN_ORIG_SIZE(size); erts_refc_init(&bptr->refc, 0); ERTS_MAGIC_BIN_DESTRUCTOR(bptr) = destructor; return bptr; diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h index b0a57a3ebe..a6596558fa 100644 --- a/erts/emulator/beam/erl_term.h +++ b/erts/emulator/beam/erl_term.h @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2000-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2000-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -38,7 +38,7 @@ struct erl_node_; /* Declared in erl_node_tables.h */ #endif #if ET_DEBUG -#define _ET_DECLARE_CHECKED(TF,F,TX) extern TF checked_##F(TX,const char*,unsigned) +#define _ET_DECLARE_CHECKED(TF,F,TX) extern TF checked_##F(TX,const char*,unsigned); #define _ET_APPLY(F,X) checked_##F(X,__FILE__,__LINE__) #else #define _ET_DECLARE_CHECKED(TF,F,TX) @@ -160,27 +160,27 @@ struct erl_node_; /* Declared in erl_node_tables.h */ /* boxed object access methods */ #define _is_aligned(x) (((Uint)(x) & 0x3) == 0) #define _unchecked_make_boxed(x) ((Uint)(x) + TAG_PRIMARY_BOXED) -_ET_DECLARE_CHECKED(Eterm,make_boxed,Eterm*); +_ET_DECLARE_CHECKED(Eterm,make_boxed,Eterm*) #define make_boxed(x) _ET_APPLY(make_boxed,(x)) #if 1 #define _is_not_boxed(x) ((x) & (_TAG_PRIMARY_MASK-TAG_PRIMARY_BOXED)) #define _unchecked_is_boxed(x) (!_is_not_boxed((x))) -_ET_DECLARE_CHECKED(int,is_boxed,Eterm); +_ET_DECLARE_CHECKED(int,is_boxed,Eterm) #define is_boxed(x) _ET_APPLY(is_boxed,(x)) #else #define is_boxed(x) (((x) & _TAG_PRIMARY_MASK) == TAG_PRIMARY_BOXED) #endif #define _unchecked_boxed_val(x) ((Eterm*)((x) - TAG_PRIMARY_BOXED)) -_ET_DECLARE_CHECKED(Eterm*,boxed_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,boxed_val,Eterm) #define boxed_val(x) _ET_APPLY(boxed_val,(x)) /* cons cell ("list") access methods */ #define _unchecked_make_list(x) ((Uint)(x) + TAG_PRIMARY_LIST) -_ET_DECLARE_CHECKED(Eterm,make_list,Eterm*); +_ET_DECLARE_CHECKED(Eterm,make_list,Eterm*) #define make_list(x) _ET_APPLY(make_list,(x)) #if 1 #define _unchecked_is_not_list(x) ((x) & (_TAG_PRIMARY_MASK-TAG_PRIMARY_LIST)) -_ET_DECLARE_CHECKED(int,is_not_list,Eterm); +_ET_DECLARE_CHECKED(int,is_not_list,Eterm) #define is_not_list(x) _ET_APPLY(is_not_list,(x)) #define is_list(x) (!is_not_list((x))) #else @@ -188,7 +188,7 @@ _ET_DECLARE_CHECKED(int,is_not_list,Eterm); #define is_not_list(x) (!is_list((x))) #endif #define _unchecked_list_val(x) ((Eterm*)((x) - TAG_PRIMARY_LIST)) -_ET_DECLARE_CHECKED(Eterm*,list_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,list_val,Eterm) #define list_val(x) _ET_APPLY(list_val,(x)) #define CONS(hp, car, cdr) \ @@ -221,10 +221,10 @@ _ET_DECLARE_CHECKED(Eterm*,list_val,Eterm); #define is_not_valid_bit_size(x) (!is_valid_bit_size((x))) #define MY_IS_SSMALL(x) (((Uint) (((x) >> (SMALL_BITS-1)) + 1)) < 2) #define _unchecked_unsigned_val(x) ((x) >> _TAG_IMMED1_SIZE) -_ET_DECLARE_CHECKED(Uint,unsigned_val,Eterm); +_ET_DECLARE_CHECKED(Uint,unsigned_val,Eterm) #define unsigned_val(x) _ET_APPLY(unsigned_val,(x)) #define _unchecked_signed_val(x) ((Sint)(x) >> _TAG_IMMED1_SIZE) -_ET_DECLARE_CHECKED(Sint,signed_val,Eterm); +_ET_DECLARE_CHECKED(Sint,signed_val,Eterm) #define signed_val(x) _ET_APPLY(signed_val,(x)) #if _TAG_IMMED1_SMALL == 0x0F @@ -247,14 +247,14 @@ _ET_DECLARE_CHECKED(Sint,signed_val,Eterm); #define is_atom(x) (((x) & _TAG_IMMED2_MASK) == _TAG_IMMED2_ATOM) #define is_not_atom(x) (!is_atom(x)) #define _unchecked_atom_val(x) ((x) >> _TAG_IMMED2_SIZE) -_ET_DECLARE_CHECKED(Uint,atom_val,Eterm); +_ET_DECLARE_CHECKED(Uint,atom_val,Eterm) #define atom_val(x) _ET_APPLY(atom_val,(x)) /* header (arityval or thing) access methods */ #define _make_header(sz,tag) ((Uint)(((sz) << _HEADER_ARITY_OFFS) + (tag))) #define is_header(x) (((x) & _TAG_PRIMARY_MASK) == TAG_PRIMARY_HEADER) #define _unchecked_header_arity(x) ((x) >> _HEADER_ARITY_OFFS) -_ET_DECLARE_CHECKED(Uint,header_arity,Eterm); +_ET_DECLARE_CHECKED(Uint,header_arity,Eterm) #define header_arity(x) _ET_APPLY(header_arity,(x)) /* arityval access methods */ @@ -262,16 +262,16 @@ _ET_DECLARE_CHECKED(Uint,header_arity,Eterm); #define is_arity_value(x) (((x) & _TAG_HEADER_MASK) == _TAG_HEADER_ARITYVAL) #define is_not_arity_value(x) (!is_arity_value((x))) #define _unchecked_arityval(x) _unchecked_header_arity((x)) -_ET_DECLARE_CHECKED(Uint,arityval,Eterm); +_ET_DECLARE_CHECKED(Uint,arityval,Eterm) #define arityval(x) _ET_APPLY(arityval,(x)) /* thing access methods */ #define is_thing(x) (is_header((x)) && header_is_thing((x))) #define _unchecked_thing_arityval(x) _unchecked_header_arity((x)) -_ET_DECLARE_CHECKED(Uint,thing_arityval,Eterm); +_ET_DECLARE_CHECKED(Uint,thing_arityval,Eterm) #define thing_arityval(x) _ET_APPLY(thing_arityval,(x)) #define _unchecked_thing_subtag(x) ((x) & _HEADER_SUBTAG_MASK) -_ET_DECLARE_CHECKED(Uint,thing_subtag,Eterm); +_ET_DECLARE_CHECKED(Uint,thing_subtag,Eterm) #define thing_subtag(x) _ET_APPLY(thing_subtag,(x)) /* @@ -301,7 +301,7 @@ _ET_DECLARE_CHECKED(Uint,thing_subtag,Eterm); #define is_binary(x) (is_boxed((x)) && is_binary_header(*boxed_val((x)))) #define is_not_binary(x) (!is_binary((x))) #define _unchecked_binary_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,binary_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,binary_val,Eterm) #define binary_val(x) _ET_APPLY(binary_val,(x)) /* process binaries stuff (special case of binaries) */ @@ -318,7 +318,7 @@ _ET_DECLARE_CHECKED(Eterm*,binary_val,Eterm); #define is_fun(x) (is_boxed((x)) && is_fun_header(*boxed_val((x)))) #define is_not_fun(x) (!is_fun((x))) #define _unchecked_fun_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,fun_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,fun_val,Eterm) #define fun_val(x) _ET_APPLY(fun_val,(x)) /* export access methods */ @@ -326,7 +326,7 @@ _ET_DECLARE_CHECKED(Eterm*,fun_val,Eterm); #define is_export(x) (is_boxed((x)) && is_export_header(*boxed_val((x)))) #define is_not_export(x) (!is_export((x))) #define _unchecked_export_val(x) _unchecked_boxed_val(x) -_ET_DECLARE_CHECKED(Eterm*,export_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,export_val,Eterm) #define export_val(x) _ET_APPLY(export_val,(x)) #define is_export_header(x) ((x) == HEADER_EXPORT) #define HEADER_EXPORT _make_header(1,_TAG_HEADER_EXPORT) @@ -336,20 +336,20 @@ _ET_DECLARE_CHECKED(Eterm*,export_val,Eterm); #define make_neg_bignum_header(sz) _make_header((sz),_TAG_HEADER_NEG_BIG) #define _is_bignum_header(x) (((x) & (_TAG_HEADER_MASK-_BIG_SIGN_BIT)) == _TAG_HEADER_POS_BIG) #define _unchecked_bignum_header_is_neg(x) ((x) & _BIG_SIGN_BIT) -_ET_DECLARE_CHECKED(int,bignum_header_is_neg,Eterm); +_ET_DECLARE_CHECKED(int,bignum_header_is_neg,Eterm) #define bignum_header_is_neg(x) _ET_APPLY(bignum_header_is_neg,(x)) #define _unchecked_bignum_header_neg(x) ((x) | _BIG_SIGN_BIT) -_ET_DECLARE_CHECKED(Eterm,bignum_header_neg,Eterm); +_ET_DECLARE_CHECKED(Eterm,bignum_header_neg,Eterm) #define bignum_header_neg(x) _ET_APPLY(bignum_header_neg,(x)) #define _unchecked_bignum_header_arity(x) _unchecked_header_arity((x)) -_ET_DECLARE_CHECKED(Uint,bignum_header_arity,Eterm); +_ET_DECLARE_CHECKED(Uint,bignum_header_arity,Eterm) #define bignum_header_arity(x) _ET_APPLY(bignum_header_arity,(x)) #define BIG_ARITY_MAX ((1 << 19)-1) #define make_big(x) make_boxed((x)) #define is_big(x) (is_boxed((x)) && _is_bignum_header(*boxed_val((x)))) #define is_not_big(x) (!is_big((x))) #define _unchecked_big_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,big_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,big_val,Eterm) #define big_val(x) _ET_APPLY(big_val,(x)) /* flonum ("float") access methods */ @@ -362,7 +362,7 @@ _ET_DECLARE_CHECKED(Eterm*,big_val,Eterm); #define is_float(x) (is_boxed((x)) && *boxed_val((x)) == HEADER_FLONUM) #define is_not_float(x) (!is_float(x)) #define _unchecked_float_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,float_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,float_val,Eterm) #define float_val(x) _ET_APPLY(float_val,(x)) /* Float definition for byte and word access */ @@ -409,7 +409,7 @@ typedef union float_def (is_boxed((x)) && *boxed_val((x)) == make_arityval((a))) #define is_not_tuple_arity(x, a) (!is_tuple_arity((x),(a))) #define _unchecked_tuple_val(x) _unchecked_boxed_val(x) -_ET_DECLARE_CHECKED(Eterm*,tuple_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,tuple_val,Eterm) #define tuple_val(x) _ET_APPLY(tuple_val,(x)) #define TUPLE0(t) \ @@ -548,11 +548,11 @@ _ET_DECLARE_CHECKED(Eterm*,tuple_val,Eterm); #define is_not_internal_pid(x) (!is_internal_pid((x))) #define _unchecked_internal_pid_data(x) _GET_PID_DATA((x)) -_ET_DECLARE_CHECKED(Uint,internal_pid_data,Eterm); +_ET_DECLARE_CHECKED(Uint,internal_pid_data,Eterm) #define internal_pid_data(x) _ET_APPLY(internal_pid_data,(x)) #define _unchecked_internal_pid_node(x) erts_this_node -_ET_DECLARE_CHECKED(struct erl_node_*,internal_pid_node,Eterm); +_ET_DECLARE_CHECKED(struct erl_node_*,internal_pid_node,Eterm) #define internal_pid_node(x) _ET_APPLY(internal_pid_node,(x)) #define internal_pid_number(x) _GET_PID_NUM(internal_pid_data((x))) @@ -604,13 +604,13 @@ _ET_DECLARE_CHECKED(struct erl_node_*,internal_pid_node,Eterm); #define is_not_internal_port(x) (!is_internal_port(x)) #define _unchecked_internal_port_data(x) _GET_PORT_DATA((x)) -_ET_DECLARE_CHECKED(Uint,internal_port_data,Eterm); +_ET_DECLARE_CHECKED(Uint,internal_port_data,Eterm) #define internal_port_data(x) _ET_APPLY(internal_port_data,(x)) #define internal_port_number(x) _GET_PORT_NUM(internal_port_data((x))) #define _unchecked_internal_port_node(x) erts_this_node -_ET_DECLARE_CHECKED(struct erl_node_*,internal_port_node,Eterm); +_ET_DECLARE_CHECKED(struct erl_node_*,internal_port_node,Eterm) #define internal_port_node(x) _ET_APPLY(internal_port_node,(x)) #define internal_port_data_words(x) (1) @@ -753,20 +753,20 @@ do { \ (!is_internal_ref((x))) #define _unchecked_internal_ref_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,internal_ref_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,internal_ref_val,Eterm) #define internal_ref_val(x) _ET_APPLY(internal_ref_val,(x)) #define _unchecked_internal_ref_data_words(x) \ (_unchecked_thing_arityval(*_unchecked_internal_ref_val(x))) -_ET_DECLARE_CHECKED(Uint,internal_ref_data_words,Eterm); +_ET_DECLARE_CHECKED(Uint,internal_ref_data_words,Eterm) #define internal_ref_data_words(x) _ET_APPLY(internal_ref_data_words,(x)) #define _unchecked_internal_ref_data(x) (_unchecked_ref_thing_ptr(x)->data.ui32) -_ET_DECLARE_CHECKED(Uint32*,internal_ref_data,Eterm); +_ET_DECLARE_CHECKED(Uint32*,internal_ref_data,Eterm) #define internal_ref_data(x) _ET_APPLY(internal_ref_data,(x)) #define _unchecked_internal_ref_node(x) erts_this_node -_ET_DECLARE_CHECKED(struct erl_node_*,internal_ref_node,Eterm); +_ET_DECLARE_CHECKED(struct erl_node_*,internal_ref_node,Eterm) #define internal_ref_node(x) _ET_APPLY(internal_ref_node,(x)) /* @@ -864,7 +864,7 @@ typedef struct external_thing_ { #define make_external_ref make_external #define _unchecked_external_val(x) _unchecked_boxed_val((x)) -_ET_DECLARE_CHECKED(Eterm*,external_val,Eterm); +_ET_DECLARE_CHECKED(Eterm*,external_val,Eterm) #define external_val(x) _ET_APPLY(external_val,(x)) #define external_thing_ptr(x) ((ExternalThing *) external_val((x))) @@ -874,7 +874,7 @@ _ET_DECLARE_CHECKED(Eterm*,external_val,Eterm); #define _unchecked_external_data_words(x) \ (_unchecked_thing_arityval(_unchecked_external_thing_ptr((x))->header) \ + (1 - EXTERNAL_THING_HEAD_SIZE)) -_ET_DECLARE_CHECKED(Uint,external_data_words,Eterm); +_ET_DECLARE_CHECKED(Uint,external_data_words,Eterm) #define external_data_words(x) _ET_APPLY(external_data_words,(x)) #define _unchecked_external_data(x) (_unchecked_external_thing_ptr((x))->data.ui) @@ -885,15 +885,15 @@ _ET_DECLARE_CHECKED(Uint,external_data_words,Eterm); #define _unchecked_external_pid_data_words(x) \ _unchecked_external_data_words((x)) -_ET_DECLARE_CHECKED(Uint,external_pid_data_words,Eterm); +_ET_DECLARE_CHECKED(Uint,external_pid_data_words,Eterm) #define external_pid_data_words(x) _ET_APPLY(external_pid_data_words,(x)) #define _unchecked_external_pid_data(x) _unchecked_external_data((x))[0] -_ET_DECLARE_CHECKED(Uint,external_pid_data,Eterm); +_ET_DECLARE_CHECKED(Uint,external_pid_data,Eterm) #define external_pid_data(x) _ET_APPLY(external_pid_data,(x)) #define _unchecked_external_pid_node(x) _unchecked_external_node((x)) -_ET_DECLARE_CHECKED(struct erl_node_*,external_pid_node,Eterm); +_ET_DECLARE_CHECKED(struct erl_node_*,external_pid_node,Eterm) #define external_pid_node(x) _ET_APPLY(external_pid_node,(x)) #define external_pid_number(x) _GET_PID_NUM(external_pid_data((x))) @@ -901,30 +901,30 @@ _ET_DECLARE_CHECKED(struct erl_node_*,external_pid_node,Eterm); #define _unchecked_external_port_data_words(x) \ _unchecked_external_data_words((x)) -_ET_DECLARE_CHECKED(Uint,external_port_data_words,Eterm); +_ET_DECLARE_CHECKED(Uint,external_port_data_words,Eterm) #define external_port_data_words(x) _ET_APPLY(external_port_data_words,(x)) #define _unchecked_external_port_data(x) _unchecked_external_data((x))[0] -_ET_DECLARE_CHECKED(Uint,external_port_data,Eterm); +_ET_DECLARE_CHECKED(Uint,external_port_data,Eterm) #define external_port_data(x) _ET_APPLY(external_port_data,(x)) #define _unchecked_external_port_node(x) _unchecked_external_node((x)) -_ET_DECLARE_CHECKED(struct erl_node_*,external_port_node,Eterm); +_ET_DECLARE_CHECKED(struct erl_node_*,external_port_node,Eterm) #define external_port_node(x) _ET_APPLY(external_port_node,(x)) #define external_port_number(x) _GET_PORT_NUM(external_port_data((x))) #define _unchecked_external_ref_data_words(x) \ _unchecked_external_data_words((x)) -_ET_DECLARE_CHECKED(Uint,external_ref_data_words,Eterm); +_ET_DECLARE_CHECKED(Uint,external_ref_data_words,Eterm) #define external_ref_data_words(x) _ET_APPLY(external_ref_data_words,(x)) #define _unchecked_external_ref_data(x) (_unchecked_external_thing_ptr((x))->data.ui32) -_ET_DECLARE_CHECKED(Uint32*,external_ref_data,Eterm); +_ET_DECLARE_CHECKED(Uint32*,external_ref_data,Eterm) #define external_ref_data(x) _ET_APPLY(external_ref_data,(x)) #define _unchecked_external_ref_node(x) _unchecked_external_node((x)) -_ET_DECLARE_CHECKED(struct erl_node_*,external_ref_node,Eterm); +_ET_DECLARE_CHECKED(struct erl_node_*,external_ref_node,Eterm) #define external_ref_node(x) _ET_APPLY(external_ref_node,(x)) /* number tests */ @@ -945,21 +945,21 @@ _ET_DECLARE_CHECKED(struct erl_node_*,external_ref_node,Eterm); #endif #define _unchecked_make_cp(x) ((Eterm)(x)) -_ET_DECLARE_CHECKED(Eterm,make_cp,Uint*); +_ET_DECLARE_CHECKED(Eterm,make_cp,Uint*) #define make_cp(x) _ET_APPLY(make_cp,(x)) #define is_not_CP(x) ((x) & _CPMASK) #define is_CP(x) (!is_not_CP(x)) #define _unchecked_cp_val(x) ((Uint*)(x)) -_ET_DECLARE_CHECKED(Uint*,cp_val,Eterm); +_ET_DECLARE_CHECKED(Uint*,cp_val,Eterm) #define cp_val(x) _ET_APPLY(cp_val,(x)) #define make_catch(x) (((x) << _TAG_IMMED2_SIZE) | _TAG_IMMED2_CATCH) #define is_catch(x) (((x) & _TAG_IMMED2_MASK) == _TAG_IMMED2_CATCH) #define is_not_catch(x) (!is_catch(x)) #define _unchecked_catch_val(x) ((x) >> _TAG_IMMED2_SIZE) -_ET_DECLARE_CHECKED(Uint,catch_val,Eterm); +_ET_DECLARE_CHECKED(Uint,catch_val,Eterm) #define catch_val(x) _ET_APPLY(catch_val,(x)) #define make_blank(X) ((X) = NIL) @@ -989,21 +989,21 @@ _ET_DECLARE_CHECKED(Uint,catch_val,Eterm); #define _is_yreg(x) (beam_reg_tag(x) == Y_REG_DEF) #define _unchecked_x_reg_offset(R) ((R) - X_REG_DEF) -_ET_DECLARE_CHECKED(Uint,x_reg_offset,Uint); +_ET_DECLARE_CHECKED(Uint,x_reg_offset,Uint) #define x_reg_offset(R) _ET_APPLY(x_reg_offset,(R)) #define _unchecked_y_reg_offset(R) ((R) - Y_REG_DEF) -_ET_DECLARE_CHECKED(Uint,y_reg_offset,Uint); +_ET_DECLARE_CHECKED(Uint,y_reg_offset,Uint) #define y_reg_offset(R) _ET_APPLY(y_reg_offset,(R)) #define reg_index(R) ((R) / sizeof(Eterm)) #define _unchecked_x_reg_index(R) ((R) >> 2) -_ET_DECLARE_CHECKED(Uint,x_reg_index,Uint); +_ET_DECLARE_CHECKED(Uint,x_reg_index,Uint) #define x_reg_index(R) _ET_APPLY(x_reg_index,(R)) #define _unchecked_y_reg_index(R) ((R) >> 2) -_ET_DECLARE_CHECKED(Uint,y_reg_index,Uint); +_ET_DECLARE_CHECKED(Uint,y_reg_index,Uint) #define y_reg_index(R) _ET_APPLY(y_reg_index,(R)) /* diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index df0ab40074..8def007c63 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -21,6 +21,7 @@ #define __GLOBAL_H__ #include "sys.h" +#include <stddef.h> /* offsetof() */ #include "erl_alloc.h" #include "erl_vm.h" #include "erl_node_container_utils.h" @@ -382,17 +383,42 @@ extern Eterm erts_ddll_monitor_driver(Process *p, ** and Binary, the macros below can convert one type to the other, as they both ** in reality are equal. */ -typedef struct binary { - Uint flags; - erts_refc_t refc; + #ifdef ARCH_32 - Uint32 align__; /* *DO NOT USE* only for alignment. */ + /* *DO NOT USE* only for alignment. */ +#define ERTS_BINARY_STRUCT_ALIGNMENT Uint32 align__; +#else +#define ERTS_BINARY_STRUCT_ALIGNMENT #endif - /* Add fields BEFORE this, otherwise the drivers crash */ + +/* Add fields in ERTS_INTERNAL_BINARY_FIELDS, otherwise the drivers crash */ +#define ERTS_INTERNAL_BINARY_FIELDS \ + Uint flags; \ + erts_refc_t refc; \ + ERTS_BINARY_STRUCT_ALIGNMENT + +typedef struct binary { + ERTS_INTERNAL_BINARY_FIELDS long orig_size; char orig_bytes[1]; /* to be continued */ } Binary; +typedef struct { + ERTS_INTERNAL_BINARY_FIELDS + long orig_size; + void (*destructor)(Binary *); + char magic_bin_data[1]; +} ErtsMagicBinary; + +typedef union { + Binary binary; + ErtsMagicBinary magic_binary; + struct { + ERTS_INTERNAL_BINARY_FIELDS + ErlDrvBinary binary; + } driver; +} ErtsBinary; + /* * 'Binary' alignment: * Address of orig_bytes[0] of a Binary should always be 8-byte aligned. @@ -400,25 +426,21 @@ typedef struct binary { * 32-bits architectures and 8 bytes on 64-bits architectures. */ -/* - * "magic" binary. - */ -typedef struct { - void (*destructor)(Binary *); - char magic_bin_data[1]; -} ErtsBinaryMagicPart; - #define ERTS_MAGIC_BIN_DESTRUCTOR(BP) \ - (((ErtsBinaryMagicPart *) (BP)->orig_bytes)->destructor) + ((ErtsBinary *) (BP))->magic_binary.destructor #define ERTS_MAGIC_BIN_DATA(BP) \ - ((void *) (((ErtsBinaryMagicPart *) (BP)->orig_bytes)->magic_bin_data)) + ((void *) ((ErtsBinary *) (BP))->magic_binary.magic_bin_data) #define ERTS_MAGIC_BIN_DATA_SIZE(BP) \ - ((BP)->orig_size - (sizeof(ErtsBinaryMagicPart) - 1)) + ((BP)->orig_size - sizeof(void (*)(Binary *))) +#define ERTS_MAGIC_BIN_ORIG_SIZE(Sz) \ + (sizeof(void (*)(Binary *)) + (Sz)) +#define ERTS_MAGIC_BIN_SIZE(Sz) \ + (sizeof(ErtsMagicBinary) - 1 + (Sz)) -#define Binary2ErlDrvBinary(B) ((ErlDrvBinary *) (&((B)->orig_size))) +#define Binary2ErlDrvBinary(B) (&((ErtsBinary *) (B))->driver.binary) #define ErlDrvBinary2Binary(D) ((Binary *) \ - (((char *) (D)) - \ - ((char *) &(((Binary *) 0)->orig_size)))) + (((char *) (D)) \ + - offsetof(ErtsBinary, driver.binary))) /* A "magic" binary flag */ #define BIN_FLAG_MAGIC 1 @@ -1406,6 +1428,11 @@ void p_slpq(_VOID_); /* utils.c */ +/* + * To be used to silence unused result warnings, but do not abuse it. + */ +void erts_silence_warn_unused_result(long unused); + void erts_cleanup_offheap(ErlOffHeap *offheap); void erts_cleanup_externals(ExternalThing *); diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index c162395159..687e6fa67b 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -3982,6 +3982,14 @@ erts_write_env(char *key, char *value) return res; } +/* + * To be used to silence unused result warnings, but do not abuse it. + */ +void erts_silence_warn_unused_result(long unused) +{ + +} + #ifdef DEBUG /* * Handy functions when using a debugger - don't use in the code! diff --git a/erts/emulator/drivers/unix/ttsl_drv.c b/erts/emulator/drivers/unix/ttsl_drv.c index 4c2514669b..4cd54c073f 100644 --- a/erts/emulator/drivers/unix/ttsl_drv.c +++ b/erts/emulator/drivers/unix/ttsl_drv.c @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 1996-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ /* @@ -142,7 +142,9 @@ static int tty_init(int,int,int,int); static int tty_set(int); static int tty_reset(int); static int ttysl_control(ErlDrvData, unsigned int, char *, int, char **, int); +#ifdef ERTS_NOT_USED static RETSIGTYPE suspend(int); +#endif static RETSIGTYPE cont(int); static RETSIGTYPE winch(int); @@ -1265,6 +1267,9 @@ static int tty_reset(int fd) /* of terminal device */ * to the orignal settings */ +#ifdef ERTS_NOT_USED +/* XXX: A mistake that it isn't used, or should it be removed? */ + static RETSIGTYPE suspend(int sig) { if (tty_reset(ttysl_fd) < 0) { @@ -1284,6 +1289,8 @@ static RETSIGTYPE suspend(int sig) } } +#endif + static RETSIGTYPE cont(int sig) { if (tty_set(ttysl_fd) < 0) { diff --git a/erts/emulator/hipe/hipe_amd64_asm.m4 b/erts/emulator/hipe/hipe_amd64_asm.m4 index 8e3faaa569..7f563c35d8 100644 --- a/erts/emulator/hipe/hipe_amd64_asm.m4 +++ b/erts/emulator/hipe/hipe_amd64_asm.m4 @@ -1,20 +1,20 @@ changecom(`/*', `*/')dnl /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2004-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ /* diff --git a/erts/emulator/hipe/hipe_amd64_bifs.m4 b/erts/emulator/hipe/hipe_amd64_bifs.m4 index 32eada24cf..f7c9604e2b 100644 --- a/erts/emulator/hipe/hipe_amd64_bifs.m4 +++ b/erts/emulator/hipe/hipe_amd64_bifs.m4 @@ -1,20 +1,20 @@ changecom(`/*', `*/')dnl /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2004-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ /* diff --git a/erts/emulator/hipe/hipe_amd64_glue.S b/erts/emulator/hipe/hipe_amd64_glue.S index c9221bac68..83b7b0397b 100644 --- a/erts/emulator/hipe/hipe_amd64_glue.S +++ b/erts/emulator/hipe/hipe_amd64_glue.S @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2004-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ /* diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c index 169d4579a2..5cca33d7eb 100644 --- a/erts/emulator/sys/common/erl_poll.c +++ b/erts/emulator/sys/common/erl_poll.c @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2006-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2006-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -350,6 +350,7 @@ unset_interrupted_chk(ErtsPollSet ps) #endif +void erts_silence_warn_unused_result(long unused); static void fatal_error(char *format, ...); static void fatal_error_async_signal_safe(char *error_str); @@ -2554,8 +2555,10 @@ fatal_error_async_signal_safe(char *error_str) int len = 0; while (error_str[len]) len++; - if (len) - (void) write(2, error_str, len); /* async signal safe */ + if (len) { + /* async signal safe */ + erts_silence_warn_unused_result(write(2, error_str, len)); + } } abort(); } diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index 183525b222..31ab5d03de 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 1996-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -709,7 +709,7 @@ prepare_crash_dump(void) if (nice_val > 39) { nice_val = 39; } - nice(nice_val); + erts_silence_warn_unused_result(nice(nice_val)); } envsz = sizeof(env); @@ -2332,7 +2332,7 @@ sys_async_ready_failed(int fd, int r, int err) char buf[120]; sprintf(buf, "sys_async_ready(): Fatal error: fd=%d, r=%d, errno=%d\n", fd, r, err); - (void) write(2, buf, strlen(buf)); + erts_silence_warn_unused_result(write(2, buf, strlen(buf))); abort(); } @@ -2891,7 +2891,7 @@ smp_sig_notify(char c) char msg[] = "smp_sig_notify(): Failed to notify signal-dispatcher thread " "about received signal"; - (void) write(2, msg, sizeof(msg)); + erts_silence_warn_unused_result(write(2, msg, sizeof(msg))); abort(); } } @@ -3121,7 +3121,6 @@ erl_sys_args(int* argc, char** argv) *argc = j; } - #ifdef ERTS_TIMER_THREAD /* diff --git a/erts/emulator/sys/unix/sys_float.c b/erts/emulator/sys/unix/sys_float.c index 15da6ab45c..c59c99f65e 100644 --- a/erts/emulator/sys/unix/sys_float.c +++ b/erts/emulator/sys/unix/sys_float.c @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2001-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2001-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -93,7 +93,8 @@ void erts_fp_check_init_error(volatile unsigned long *fpexnp) char buf[64]; snprintf(buf, sizeof buf, "ERTS_FP_CHECK_INIT at %p: detected unhandled FPE at %p\r\n", __builtin_return_address(0), (void*)*fpexnp); - write(2, buf, strlen(buf)); + if (write(2, buf, strlen(buf)) <= 0) + erl_exit(ERTS_ABORT_EXIT, "%s", buf); *fpexnp = 0; #if defined(__i386__) || defined(__x86_64__) erts_restore_fpu(); diff --git a/erts/emulator/zlib/Makefile.in b/erts/emulator/zlib/Makefile.in index 5c99b460c1..b44a87551d 100644 --- a/erts/emulator/zlib/Makefile.in +++ b/erts/emulator/zlib/Makefile.in @@ -14,12 +14,7 @@ # make install prefix=$HOME ARFLAGS = rc -ifeq ($(findstring ose,$(TARGET)),ose) - TYPE_FLAGS = -else - TYPE_FLAGS = -O3 -endif -CFLAGS = @CFLAGS@ @DEFS@ @EMU_THR_DEFS@ $(TYPE_FLAGS) +CFLAGS = $(subst -O2, -O3, @CFLAGS@ @DEFS@ @EMU_THR_DEFS@) #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 #CFLAGS=-g -DDEBUG #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ @@ -36,24 +31,15 @@ OBJS = $(O:%=$(OBJDIR)/%) include $(ERL_TOP)/make/target.mk -# On windows we need a separate zlib during debug build -ifeq ($(TARGET),win32) - -ifeq ($(TYPE),debug) -CFLAGS = $(subst -O2, -g, @CFLAGS@ @DEFS@ @DEBUG_FLAGS@) -endif # debug - -else # win32 - ifeq ($(TYPE),gcov) -CFLAGS = $(subst -O2, -g, -O0 -fprofile-arcs -ftest-coverage @CFLAGS@ @DEFS@ @DEBUG_FLAGS@) -TYPE_FLAGS= +CFLAGS = -O0 -fprofile-arcs -ftest-coverage @DEBUG_CFLAGS@ @DEFS@ @EMU_THR_DEFS@ else # gcov -# On other platforms we use no special debug version of zlib +ifeq ($(TYPE),debug) +CFLAGS = @DEBUG_CFLAGS@ @DEFS@ @EMU_THR_DEFS@ +endif # debug endif # gcov -endif # win32 - +# On windows we *need* a separate zlib during debug build OBJDIR= $(ERL_TOP)/erts/emulator/zlib/obj/$(TARGET)/$(TYPE) include $(ERL_TOP)/make/$(TARGET)/otp.mk diff --git a/erts/include/internal/tile/atomic.h b/erts/include/internal/tile/atomic.h index 0622b53729..59a9250e7c 100644 --- a/erts/include/internal/tile/atomic.h +++ b/erts/include/internal/tile/atomic.h @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2008-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2008-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ @@ -84,13 +84,13 @@ ethr_native_atomic_add_return(ethr_native_atomic_t *var, long incr) static ETHR_INLINE long ethr_native_atomic_inc_return(ethr_native_atomic_t *var) { - return ethr_native_atomic_add_return(&var->counter, 1); + return ethr_native_atomic_add_return(var, 1); } static ETHR_INLINE long ethr_native_atomic_dec_return(ethr_native_atomic_t *var) { - return ethr_native_atomic_add_return(&var->counter, -1); + return ethr_native_atomic_add_return(var, -1); } static ETHR_INLINE long diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl index 89d893f8c1..ffe58ae7a9 100644 --- a/lib/kernel/src/code.erl +++ b/lib/kernel/src/code.erl @@ -465,7 +465,8 @@ search([{Dir, File} | Tail]) -> build([]) -> []; build([Dir|Tail]) -> - Files = filter(objfile_extension(), Dir, file:list_dir(Dir)), + Files = filter(objfile_extension(), Dir, + erl_prim_loader:list_dir(Dir)), [decorate(Files, Dir) | build(Tail)]. decorate([], _) -> []; diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index 8e1e3d5390..37b9200942 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -26,7 +26,7 @@ delete/1, purge/1, soft_purge/1, is_loaded/1, all_loaded/1, load_binary/1, dir_req/1, object_code/1, set_path_file/1, sticky_dir/1, pa_pz_option/1, add_del_path/1, - dir_disappeared/1, ext_mod_dep/1, + dir_disappeared/1, ext_mod_dep/1, clash/1, load_cached/1, start_node_with_cache/1, add_and_rehash/1, where_is_file_cached/1, where_is_file_no_cache/1, purge_stacktrace/1, mult_lib_roots/1, bad_erl_libs/1, @@ -48,7 +48,7 @@ all(suite) -> delete, purge, soft_purge, is_loaded, all_loaded, load_binary, dir_req, object_code, set_path_file, pa_pz_option, add_del_path, - dir_disappeared, ext_mod_dep, + dir_disappeared, ext_mod_dep, clash, load_cached, start_node_with_cache, add_and_rehash, where_is_file_no_cache, where_is_file_cached, purge_stacktrace, mult_lib_roots, bad_erl_libs, @@ -531,7 +531,7 @@ pa_pz_option(Config) when is_list(Config) -> add_del_path(suite) -> []; add_del_path(doc) -> ["add_path, del_path should not cause priv_dir(App) to fail"]; -add_del_path(Config) -> +add_del_path(Config) when is_list(Config) -> DDir = ?config(data_dir,Config), Dir1 = filename:join(DDir,"dummy_app-1.0/ebin"), Dir2 = filename:join(DDir,"dummy_app-2.0/ebin"), @@ -545,6 +545,38 @@ add_del_path(Config) -> ok. +clash(Config) when is_list(Config) -> + DDir = ?config(data_dir,Config)++"clash/", + P = code:get_path(), + + %% test non-clashing entries + + %% remove "." to prevent clash with test-server path + ?line true = code:del_path("."), + ?line true = code:add_path(DDir++"foobar-0.1/ebin"), + ?line true = code:add_path(DDir++"zork-0.8/ebin"), + ?line test_server:capture_start(), + ?line code:clash(), + ?line test_server:capture_stop(), + ?line OKMsg = test_server:capture_get(), + ?line lists:prefix("** Found 0 name clashes in code paths", OKMsg), + ?line true = code:set_path(P), + + %% test clashing entries + + %% remove "." to prevent clash with test-server path + ?line true = code:del_path("."), + ?line true = code:add_path(DDir++"foobar-0.1/ebin"), + ?line true = code:add_path(DDir++"foobar-0.1.ez/foobar-0.1/ebin"), + ?line test_server:capture_start(), + ?line code:clash(), + ?line test_server:capture_stop(), + ?line [ErrMsg1|_] = test_server:capture_get(), + ?line {match, [" hides "]} = re:run(ErrMsg1, "\\*\\* .*( hides ).*", + [{capture,all_but_first,list}]), + ?line true = code:set_path(P), + ok. + ext_mod_dep(suite) -> []; ext_mod_dep(doc) -> diff --git a/lib/kernel/test/code_SUITE_data/clash/foobar-0.1.ez b/lib/kernel/test/code_SUITE_data/clash/foobar-0.1.ez Binary files differnew file mode 100644 index 0000000000..33d8a59b92 --- /dev/null +++ b/lib/kernel/test/code_SUITE_data/clash/foobar-0.1.ez diff --git a/lib/kernel/test/code_SUITE_data/clash/foobar-0.1/ebin/baz.beam b/lib/kernel/test/code_SUITE_data/clash/foobar-0.1/ebin/baz.beam new file mode 100644 index 0000000000..da87f32b9f --- /dev/null +++ b/lib/kernel/test/code_SUITE_data/clash/foobar-0.1/ebin/baz.beam @@ -0,0 +1 @@ +baz 298734 diff --git a/lib/kernel/test/code_SUITE_data/clash/foobar-0.1/ebin/blarg.beam b/lib/kernel/test/code_SUITE_data/clash/foobar-0.1/ebin/blarg.beam new file mode 100644 index 0000000000..e4c70c267c --- /dev/null +++ b/lib/kernel/test/code_SUITE_data/clash/foobar-0.1/ebin/blarg.beam @@ -0,0 +1 @@ +baz 86234 diff --git a/lib/kernel/test/code_SUITE_data/clash/zork-0.8.ez b/lib/kernel/test/code_SUITE_data/clash/zork-0.8.ez Binary files differnew file mode 100644 index 0000000000..051fa1efe4 --- /dev/null +++ b/lib/kernel/test/code_SUITE_data/clash/zork-0.8.ez diff --git a/lib/kernel/test/code_SUITE_data/clash/zork-0.8/ebin/bork.beam b/lib/kernel/test/code_SUITE_data/clash/zork-0.8/ebin/bork.beam new file mode 100644 index 0000000000..7b292c0b44 --- /dev/null +++ b/lib/kernel/test/code_SUITE_data/clash/zork-0.8/ebin/bork.beam @@ -0,0 +1 @@ +baz 23784 diff --git a/lib/kernel/test/code_SUITE_data/clash/zork-0.8/ebin/flarp.beam b/lib/kernel/test/code_SUITE_data/clash/zork-0.8/ebin/flarp.beam new file mode 100644 index 0000000000..7b2f6a850f --- /dev/null +++ b/lib/kernel/test/code_SUITE_data/clash/zork-0.8/ebin/flarp.beam @@ -0,0 +1 @@ +baz 3246238 diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c index 63177121bc..6a920e6c76 100644 --- a/lib/odbc/c_src/odbcserver.c +++ b/lib/odbc/c_src/odbcserver.c @@ -1,19 +1,19 @@ /* * %CopyrightBegin% - * - * Copyright Ericsson AB 1999-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 1999-2010. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% * @@ -749,11 +749,12 @@ static db_result_msg db_param_query(byte *buffer, db_state *state) byte *sql; db_result_msg msg; int i, num_param_values, ver = 0, - erl_type = 0, index = 0, size = 0, cols = 0; + erl_type = 0, index = 0, size = 0, cols = 0; long long_num_param_values; param_status param_status; diagnos diagnos; - param_array *params; + param_array *params; + SQLRETURN result; if (associated_result_set(state)) { clean_state(state); @@ -784,10 +785,16 @@ static db_result_msg db_param_query(byte *buffer, db_state *state) num_param_values, state); if(params != NULL) { - if(!sql_success(SQLExecDirect(statement_handle(state), - sql, SQL_NTS))) { - diagnos = get_diagnos(SQL_HANDLE_STMT, statement_handle(state)); - msg = encode_error_message(diagnos.error_msg); + + result = SQLExecDirect(statement_handle(state), sql, SQL_NTS); + if (!sql_success(result) || result == SQL_NO_DATA) { + diagnos = get_diagnos(SQL_HANDLE_STMT, statement_handle(state)); + } + /* SQL_NO_DATA and SQLSTATE 00000 indicate success for + updates/deletes that affect no rows */ + if(!sql_success(result) && + !(result == SQL_NO_DATA && !strcmp((char *)diagnos.sqlState, INFO))) { + msg = encode_error_message(diagnos.error_msg); } else { for (i = 0; i < param_status.params_processed; i++) { switch (param_status.param_status_array[i]) { @@ -2452,6 +2459,7 @@ static diagnos get_diagnos(SQLSMALLINT handleType, SQLHANDLE handle) int acc_errmsg_size; byte *current_errmsg_pos; SQLCHAR current_sql_state[SQL_STATE_SIZE]; + SQLRETURN result; diagnos.error_msg[0] = 0; @@ -2464,10 +2472,10 @@ static diagnos get_diagnos(SQLSMALLINT handleType, SQLHANDLE handle) /* Foreach diagnostic record in the current set of diagnostic records the error message is obtained */ for(record_nr = 1; ;record_nr++) { - if(SQLGetDiagRec(handleType, handle, record_nr, current_sql_state, + result = SQLGetDiagRec(handleType, handle, record_nr, current_sql_state, &nativeError, current_errmsg_pos, - (SQLSMALLINT)errmsg_buffer_size, &errmsg_size) - != SQL_SUCCESS) { + (SQLSMALLINT)errmsg_buffer_size, &errmsg_size); + if(result != SQL_SUCCESS && result != SQL_NO_DATA) { break; diff --git a/xcomp/README b/xcomp/README index 4cb577471a..f4285cd16f 100644 --- a/xcomp/README +++ b/xcomp/README @@ -1,5 +1,5 @@ =============================================================================== - Cross compiling Erlang/OTP + Cross Compiling Erlang/OTP =============================================================================== %CopyrightBegin% @@ -244,14 +244,14 @@ build machine and the cross host system. $ ./otp_build boot -a - 'otp_build boot -a' will first build a bootstrap system -for the build machine and then do the cross build of the system. +`otp_build boot -a' will first build a bootstrap system for the build machine +and then do the cross build of the system. [11] $ ./otp_build release -a <RELEASE_DIR> -'otp_build release -a' will do the same as [5], and you will after this have +`otp_build release -a' will do the same as [5], and you will after this have to do a manual install either by doing [6], or [7]. ======== Currently used configuration variables =============================== @@ -312,13 +312,15 @@ not need to set these variables (where `<HOST>' is what has been passed as * CXXFLAGS - C++ compiler flags. -* LD - Linker +* LD - Linker. * LDFLAGS - Linker flags. --- Dynamic Erlang Driver linker flags. -- +* LIBS - Libraries. -NOTE! Either define all or non of the DED_LD* variables. +-- Dynamic Erlang Driver linker flags -- + +NOTE! Either set all or non of the DED_LD* variables. * DED_LD - Linker. @@ -328,11 +330,23 @@ NOTE! Either define all or non of the DED_LD* variables. This flag should set a specific runtime library path for the shared library at link time. +-- Large file support -- + +NOTE! Either set all or non of the LFS_* variables. + +* LFS_CFLAGS - Large file support C compiler flags. + +* LFS_LDFLAGS - Large file support linker flags. + +* LFS_LIBS - Large file support libraries. + -- Other tools -- -* RANLIB - ranlib +* RANLIB - `ranlib' archive index tool. -* AR - ar +* AR - `ar' archiving tool. + +* GETCONF - `getconf' system configuration inspection tool. -------- Cross System Root Locations ------------------------------------------ @@ -356,6 +370,10 @@ These tests cannot (always) be done automatically when cross compiling. You usually does not need to set these variables. Only set these if you really know what you are doing. +Note that some of these values will override results of tests performed +by `configure', and some will not be used until `configure' is sure that +it cannot figure the result out. + The `configure' script will issue a warning when a default value is used. When a variable has been set, no warning will be issued. diff --git a/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf index 67da8b5abb..5ceb4ec145 100644 --- a/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf +++ b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf @@ -94,15 +94,18 @@ erl_xcomp_configure_flags="--without-termcap" ## CXXFLAGS - C++ compiler flags. #CXXFLAGS= -## LD - Linker +## LD - Linker. #LD= ## LDFLAGS - Linker flags. #LDFLAGS= -### -- Dynamic Erlang Driver linker flags. -- +## LIBS - Libraries. +#LIBS= -### NOTE! Either define all or non of the DED_LD* variables. +### -- Dynamic Erlang Driver linker flags -- + +### NOTE! Either set all or non of the DED_LD* variables. ## DED_LD - Linker. #DED_LD= @@ -115,14 +118,30 @@ erl_xcomp_configure_flags="--without-termcap" ## library at link time. #DED_LD_FLAG_RUNTIME_LIBRARY_PATH= +### -- Large file support -- + +### NOTE! Either set all or non of the LFS_* variables. + +## LFS_CFLAGS - Large file support C compiler flags. +#LFS_CFLAGS= + +## LFS_LDFLAGS - Large file support linker flags. +#LFS_LDFLAGS= + +## LFS_LIBS - Large file support libraries. +#LFS_LIBS= + ### -- Other tools -- -## RANLIB - ranlib +## RANLIB - `ranlib' archive index tool. #RANLIB= -## AR - ar +## AR - `ar' archiving tool. #AR= +## GETCONF - `getconf' system configuration inspection tool. +#GETCONF= + ### ---- Cross System Root Locations ------------------------------------------ ## erl_xcomp_sysroot - Absolute cross system root path. @@ -147,6 +166,10 @@ erl_xcomp_sysroot="$TILERA_ROOT/tile" ### usually does not need to set these variables. Only set these if you really ### know what you are doing. +### Note that some of these values will override results of tests performed +### by `configure', and some will not be used until `configure' is sure that +### it cannot figure the result out. + ### The `configure' script will issue a warning when a default value is used. ### When a variable has been set, no warning will be issued. diff --git a/xcomp/erl-xcomp-vxworks_ppc32.conf b/xcomp/erl-xcomp-vxworks_ppc32.conf index fbd23c2fb9..aa7c652d80 100644 --- a/xcomp/erl-xcomp-vxworks_ppc32.conf +++ b/xcomp/erl-xcomp-vxworks_ppc32.conf @@ -94,15 +94,18 @@ CPP="$CC $CFLAGS -E" ## CXXFLAGS - C++ compiler flags. #CXXFLAGS= -## LD - Linker +## LD - Linker. LD="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/ldppc" ## LDFLAGS - Linker flags. LDFLAGS="-mlongcall" -### -- Dynamic Erlang Driver linker flags. -- +## LIBS - Libraries. +#LIBS= -### NOTE! Either define all or non of the DED_LD* variables. +### -- Dynamic Erlang Driver linker flags -- + +### NOTE! Either set all or non of the DED_LD* variables. ## DED_LD - Linker. #DED_LD= @@ -115,14 +118,30 @@ LDFLAGS="-mlongcall" ## library at link time. #DED_LD_FLAG_RUNTIME_LIBRARY_PATH= +### -- Large file support -- + +### NOTE! Either set all or non of the LFS_* variables. + +## LFS_CFLAGS - Large file support C compiler flags. +#LFS_CFLAGS= + +## LFS_LDFLAGS - Large file support linker flags. +#LFS_LDFLAGS= + +## LFS_LIBS - Large file support libraries. +#LFS_LIBS= + ### -- Other tools -- -## RANLIB - ranlib +## RANLIB - `ranlib' archive index tool. RANLIB="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/ranlibppc" -## AR - ar +## AR - `ar' archiving tool. AR="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/arppc" +## GETCONF - `getconf' system configuration inspection tool. +#GETCONF= + ### ---- Cross System Root Locations ------------------------------------------ ## erl_xcomp_sysroot - Absolute cross system root path. @@ -147,6 +166,10 @@ AR="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/arppc" ### usually does not need to set these variables. Only set these if you really ### know what you are doing. +### Note that some of these values will override results of tests performed +### by `configure', and some will not be used until `configure' is sure that +### it cannot figure the result out. + ### The `configure' script will issue a warning when a default value is used. ### When a variable has been set, no warning will be issued. diff --git a/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf b/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf index b6730cff0a..1d57876172 100644 --- a/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf +++ b/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf @@ -94,15 +94,18 @@ CXX=x86_64-saf-g++ ## CXXFLAGS - C++ compiler flags. #CXXFLAGS= -## LD - Linker +## LD - Linker. LD=x86_64-saf-ld ## LDFLAGS - Linker flags. #LDFLAGS= -### -- Dynamic Erlang Driver linker flags. -- +## LIBS - Libraries. +#LIBS= -### NOTE! Either define all or non of the DED_LD* variables. +### -- Dynamic Erlang Driver linker flags -- + +### NOTE! Either set all or non of the DED_LD* variables. ## DED_LD - Linker. #DED_LD= @@ -115,14 +118,30 @@ LD=x86_64-saf-ld ## library at link time. #DED_LD_FLAG_RUNTIME_LIBRARY_PATH= +### -- Large file support -- + +### NOTE! Either set all or non of the LFS_* variables. + +## LFS_CFLAGS - Large file support C compiler flags. +#LFS_CFLAGS= + +## LFS_LDFLAGS - Large file support linker flags. +#LFS_LDFLAGS= + +## LFS_LIBS - Large file support libraries. +#LFS_LIBS= + ### -- Other tools -- -## RANLIB - ranlib +## RANLIB - `ranlib' archive index tool. RANLIB=x86_64-saf-ranlib -## AR - ar +## AR - `ar' archiving tool. AR=x86_64-saf-ar +## GETCONF - `getconf' system configuration inspection tool. +#GETCONF= + ### ---- Cross System Root Locations ------------------------------------------ ## erl_xcomp_sysroot - Absolute cross system root path. @@ -147,6 +166,10 @@ erl_xcomp_sysroot="$SAF_SYSROOT_X86_64" ### usually does not need to set these variables. Only set these if you really ### know what you are doing. +### Note that some of these values will override results of tests performed +### by `configure', and some will not be used until `configure' is sure that +### it cannot figure the result out. + ### The `configure' script will issue a warning when a default value is used. ### When a variable has been set, no warning will be issued. diff --git a/xcomp/erl-xcomp.conf.template b/xcomp/erl-xcomp.conf.template index 9242318577..afbef66af1 100644 --- a/xcomp/erl-xcomp.conf.template +++ b/xcomp/erl-xcomp.conf.template @@ -94,15 +94,18 @@ ## CXXFLAGS - C++ compiler flags. #CXXFLAGS= -## LD - Linker +## LD - Linker. #LD= ## LDFLAGS - Linker flags. #LDFLAGS= -### -- Dynamic Erlang Driver linker flags. -- +## LIBS - Libraries. +#LIBS= -### NOTE! Either define all or non of the DED_LD* variables. +### -- Dynamic Erlang Driver linker flags -- + +### NOTE! Either set all or non of the DED_LD* variables. ## DED_LD - Linker. #DED_LD= @@ -115,14 +118,30 @@ ## library at link time. #DED_LD_FLAG_RUNTIME_LIBRARY_PATH= +### -- Large file support -- + +### NOTE! Either set all or non of the LFS_* variables. + +## LFS_CFLAGS - Large file support C compiler flags. +#LFS_CFLAGS= + +## LFS_LDFLAGS - Large file support linker flags. +#LFS_LDFLAGS= + +## LFS_LIBS - Large file support libraries. +#LFS_LIBS= + ### -- Other tools -- -## RANLIB - ranlib +## RANLIB - `ranlib' archive index tool. #RANLIB= -## AR - ar +## AR - `ar' archiving tool. #AR= +## GETCONF - `getconf' system configuration inspection tool. +#GETCONF= + ### ---- Cross System Root Locations ------------------------------------------ ## erl_xcomp_sysroot - Absolute cross system root path. @@ -147,6 +166,10 @@ ### usually does not need to set these variables. Only set these if you really ### know what you are doing. +### Note that some of these values will override results of tests performed +### by `configure', and some will not be used until `configure' is sure that +### it cannot figure the result out. + ### The `configure' script will issue a warning when a default value is used. ### When a variable has been set, no warning will be issued. |